/ Published in: SQL

Field1 + Field2 + Field3 should create 1 entry for each unique row in the DB. In an employee table, this would be FirstName + LastName + EmployeeNumber
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
SELECT * FROM TABLE WHERE field1 + field2 + field3 IN ( SELECT field1 + field2 + field3 FROM TABLE GROUP BY field1 + field2 + field3 HAVING COUNT(*) > 1 ) AND uniqueID NOT IN ( SELECT MAX(uniqueID) FROM xer_regis_new GROUP BY field1 + field2 + field3 HAVING COUNT(*) > 1 )
Comments
