当前位置: 代码迷 >> Sql Server >> 查询titles表中pub_id出现次数超过6次以上的记录解决方案
详细解决方案
查询titles表中pub_id出现次数超过6次以上的记录解决方案
热度:82 发布时间:2016-04-27 17:38:00.0
查询titles表中pub_id出现次数超过6次以上的记录 如题``
------解决方案-------------------- select * from titles where pub_id in ( select pub_id from titles group by pub_id having count(*)> 6 ) ------解决方案-------------------- select pub_id from 表 group by pub_id having count(pub_id)> 6