How to get rows only contains multiple ID using SQL?
You can try this:

SQL&gt; select * from dummy;

    ID    FOO
---------- ----------
     1    100
     1    200
     1    200
     2    300
     2    300
     3    200
     4    200

7 rows selected.

SQL&gt; select * from dummy where id in (select id from dummy having count(*) &gt; 1 group by id);

    ID    FOO
---------- ----------
     1    100
     1    200
     1    200
     2    300
     2    300

SQL&gt;