SELECT * FROM ( SELECT * , ROW_NUMBER OVER (PARTITION BY id) AS row FROM tmp_table ) as t WHERE row >= 2;
または、 SELECT id FROM tmp_table GROUP BY id HAVING count(*) >= 2;
0 件のコメント:
コメントを投稿