|
-
Jul 27th, 2000, 12:10 AM
#1
Thread Starter
Member
Use the DISTINCT or DISTINCTROW command in you SELECT SQL statement.
The DISTINCT clause is used to remove duplicate records from the resulting data set. i.e. "SELECT DISTINCT MyName FROM tblNames"
This will return one entry for each MyName that exists, so if there are two or more "Colin's" in your table it will only show one thus........
MyName MyLastName Age
Colin Green Old
Colin Green Old
Colin Green 35
Peter Paul 41
Will return
MyName
Colin
Peter
The DISTINCTROW clause is used to select data that is distinct in any of the fields. i.e. "SELECT DISTINCTROW * FROM tblNames"
This will return one entry for each non duplicate record that, so if there are two or more "Colin's" in your table it will return any unique records thus.............
MyName MyLastName Age
Colin Green Old
Colin Green 35
Peter Paul 41
Hope this helps!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|