如何查询特定字段值的记录?

数据库中某字段值允许重复
如何列出该字段所有具有重复值的记录?
---------------------------------------------------------------

哎,看错了楼主的要求
select * from yourtable where a in (select a from yourtable group by a having count(a)>1)
---------------------------------------------------------------

select aaa,count(aaa) as num from table where 1=1
group by aaa having count(aaa)>1

Published At
Categories with Web编程
comments powered by Disqus