U
U
ugovin2014-10-20 20:52:19
MySQL
ugovin, 2014-10-20 20:52:19

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

1 answer(s)
A
Anton, 2014-10-20
@zeromodule

SELECT cid, COUNT(cid)
FROM table
GROUP BY cid
HAVING COUNT(cid) > 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question