I want to pull out duplicate records in a MySQL database.
----------------------------
| id | column_a | column_b |
|----|----------|----------|
| 1 | a | b |
| 2 | a | c |
| 3 | a | d |
| 4 | a | b |
| 5 | b | e |
| 6 | c | a |
| 7 | c | d |
| 8 | e | a |
| 9 | e | a |
----------------------------
I would like to pull it so that it shows each row that is a duplicate. Something like :
------
| id |
|----|
| 1 |
| 4 |
| 8 |
| 9 |
------
or
---------------------------------------
| duplicate_ids | column_a | column_b |
|---------------|----------|----------|
| 1,4 | a | b |
| 8,9 | e | a |
---------------------------------------
Any thoughts on how this can be done?