Here is a quick way to list duplicate rows in a table using an SQL SELECT statement with a subquery:
SELECT * FROM orders WHERE custno IN (SELECT custno FROM orders GROUP BY custno HAVING COUNT(*) > 1) ORDER BY custno
This SQL statement will produce a list containing every column of the rows in the orders table that contain a duplicate customer number.
- Robert Riches
LATEST COMMENTS
MC Press Online