Find duplicates

From MyWiki
Jump to: navigation, search
SELECT emosid, COUNT(username) AS cnt FROM staffuser_copy GROUP BY emosid HAVING cnt >1;

Getting rid of duplicate lines in a multi column table

SELECT DISTINCT state, city
FROM customers
WHERE state IS NOT NULL
ORDER BY state, city