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):
which returns heaps of rows (not sure why). I've also tried:
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
But I think this is finding rows that have the same first name OR last name, not both in the same row..
group by first_name,
having count(*) > 1
How do I do this?
Thanks in advance!