Categories
How to write a query to display duplicate values for a table column?
The table has a field cid of type int. I don't know if there are duplicate values or if it's unique. What query can display duplicate values?
Answer the question
In order to leave comments, you need to log in
SELECT cid, COUNT(cid) FROM table GROUP BY cid HAVING COUNT(cid) > 1
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question