sql选取相同的行

46次阅读

一个表有50万行
怎么选取相同的行?

select * from table1 a where (select count(1) from table1 where col1=a.col1)>1

太慢了,好久了还木有出来~
求招式阿~

Anakin

试试这个呢
SELECT * FROM table GROUP BY col HAVING count(col)>1

不烦恼

正文完