I have a table in this form:
id | firstname | lastname
---+-----------+----------
1 | alex | marti
2 | mark | finger
3 | alex | marti
4 | ted
you can do the following to show all the id column values
SELECT GROUP_CONCAT(DISTINCT id SEPARATOR ',') AS ids, firstname, lastname FROM t GROUP BY firstname, lastname HAVING COUNT(*) > 1
This should show something like this:
ids | firstname | lastname
----+-----------+----------
1,3 | alex | marti