I have table with one column, and I need to get all duplicated lines. This is table:
| name |
| ----- |
| a |
| a |
| b |
| c |
| c |
| d |
And this is expected result set:
| name |
| ----- |
| a |
| a |
| c |
| c |
I already do this that way:
SELECT t.name FROM my_table t inner join (
SELECT name, count(1) AS count FROM my_table t2 GROUP BY t2.name HAVING count > 1
) AS t1 on t1.name = t.name
Is it possible to do it without subquery?