Ysgrifennodd ViSolve DB Team:
Hi Renish,

If you want to capture the entries which are entered more than once. Here's the answer for it.

mysql> select * from a;
+--------+
| b      |
+--------+
| pen    |
| pencil |
| rubber |
| pen    |
| paper  |
| paper  |
+--------+
6 rows in set (0.00 sec)

mysql> select b from a group by b having count(b)>1;
+-------+
| b     |
+-------+
| paper |
| pen   |
+-------+
2 rows in set (0.00 sec)

Hope this helps.


Thanks,
ViSolve DB Team.
Or (IIRC):

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


Peter


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to