I have a table with legitimate and illegitimate records. I want to run a query based on one field, serial_number, that will show the serial number and a count of the records of interest.
The following SQL works, but it takes several minutes.
SELECT DISTINCT sn, count(*)
FROM...