Find duplicates

From MyWiki
Revision as of 17:50, 21 October 2014 by George2 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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