Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct versus distinctrow

Other

Distinct versus distinctrow

by  randysmid  Posted    (Edited  )
Hi,
As most people know, you can add the keyword "DISTINCT" to your SQL statement to retrieve unique records based on a field. Example:
SELECT DISTINCT LastName FROM Employees;

The "DISTINCT" keyword will only base its's search on a field, whereas the "DISTINCTROW" will base its' search on the entire record. This is extremely useful in searching for identical records that might have been posted to the database twice (in error).

In the Query Properties, this is represented by "Unique Values" (aka DISTINCT) and "Unique Records" (aka DISTINCTROW). These properties can be set to Yes or No. The default value for both of them is "No".

Comments, questions, suggestions?
rsmith@cta.org

Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top