Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM Binaries » View Thread |
Messages 1 to 1 of 1 total |
Listing Duplicate Rows |
Fri, Dec 4 2009 4:06 PM | Permanent Link |
Richard Harding | Tim,
I have attached the backup file to demonstrate the following query. SELECT ID, FName, MName, LName FROM Contacts C1 WHERE C1.FName ||C1.MName || C1.LName IN (SELECT C2.FName ||C2.MName || C2.LName FROM Contacts C2 GROUP BY FName, MName, LName HAVING COUNT(*) > 1) However, it gives the result: ID, FName, MName, LName 2 | Mary | A | Doe | 4 | Mary | A | Doe | Add the word DISTINCT and the correct results appear. SELECT DISTINCT ID, FName, MName, LName FROM Contacts C1 WHERE C1.FName ||C1.MName || C1.LName IN (SELECT C2.FName ||C2.MName || C2.LName FROM Contacts C2 GROUP BY FName, MName, LName HAVING COUNT(*) > 1) Richard Harding Attachments: TestDB Backup On 2009-12-05.EDBBkp |
This web page was last updated on Wednesday, April 24, 2024 at 11:07 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |