Home

SQL Keywords: DISTINCT

  

Refreshing a Combo Box

The DISTINCT keyword is used to distinctly select a record. Here is an example:

SELECT DISTINCT Employees.LastName " & _
FROM   Employees " & _
WHERE  LastName = 'Sands';"

If you are creating a SELECT statement that involves a relationship, use the DISTINCTROW operator to get distinct records. Here is an example:

SELECT DISTINCTROW Videos.CopyrightYear,
		   Sum(Videos.PriceBought) AS [Sum Of PriceBought],
		   Count(*) AS [Count Of Videos]
FROM Videos
GROUP BY Videos.CopyrightYear
HAVING (((Videos.CopyrightYear) Is Not Null));

Home Copyright © 2009-2016, FunctionX, Inc.