Fortuno, Adam wrote:

I would suggest a SQL statement like this to get the results you're looking
for.

SELECT COUNT(a.id), a.lname, a.fname
FROM people AS a
GROUP BY a.lname, a.fname
HAVING COUNT(a.id) > 1;


That's a great way of doing it if Grant doesn't need the IDs, which he *did* have listed in his original question. If IDs are needed, try this:

SELECT a.id, a.lname, a.fname, count(b.id)
 FROM people a LEFT JOIN people b ON a.lname = b.lname AND a.fname =
b.fname
 GROUP BY a.id, a.lname, a.fname
 HAVING count(b.id) > 1;

I haven't tested this, but I think it ought to work OK.

Bruce Feist




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



Reply via email to