Friday, January 8, 2010

Selecting non-distinct rows in MySQL

Got this here.

SELECT *, COUNT(*) AS count FROM tablename GROUP BY fieldname HAVING count > 1

No comments:

Post a Comment