Hey, I am trying to find rows that have the same value for 2 columns in my table. Specifically duplicate people in the table (same first and last names).
I have tried the following (plus some variations):
Code:
SELECT * FROM `table_name` as t1
INNER JOIN `table_name` as t2
ON t1.last_name = t2.last_name AND t1.first_name = t2.first_name
which returns heaps of rows (not sure why). I've also tried:
Code:
select   first_name,
         last_name,
         count(*)
from    table_name
group by first_name,
         last_name
having   count(*) > 1
But I think this is finding rows that have the same first name OR last name, not both in the same row..

How do I do this?
Thanks in advance!