技术开发 频道

根据数据库表里的记录,查询重复记录最多次的记录


【IT168技术文档】

select top(1)* from num where value=(select value from (select count(value) as b,value from num group by value) as bb where bb.b=(select max(b) from (select count(value) as b,value from num group by value) as dd)) 法二: SELECT TOP 1 * FROM (SELECT value, COUNT(value) AS c FROM num GROUP BY value) DERIVEDTBL ORDER BY c DESC
0
相关文章