I have a table in this form:
id | firstname | lastname
---+-----------+----------
1 | alex | marti
2 | mark | finger
3 | alex | marti
4 | ted | port
Need to return the firstname
, lastname
duplicates in this form:
1 | alex | marti
3 | alex | marti
I tried doing select firstname, lastname from t group by firstname, lastname having count(*) > 1
but that will return something like
firstname | lastname
----------+----------
mark | finger
alex | marti
ted | port
And I need the id
of the duplicates but of course select id, firstname, lastname from t group by id, firstname, lastname
won't work.
Any ideas? Thanks.