I have a table in this form:
id | firstname | lastname
---+-----------+----------
1 | alex | marti
2 | mark | finger
3 | alex | marti
4 | ted
You need to aggregate the id. If you need only the ID of one of them, for, say, deletion, you could do:
select max(id) id, firstname, lastname from t group by firstname, lastname having count(*) > 1
If you want both id's and know there will never be more than 2, you could do the following:
select min(id) minid, max(id) maxid, firstname, lastname from t group by firstname, lastname having count(*) > 1
If you want all duplicates, along with their id's, you'll have to use a derived table, as in Nitin Midha's answer.