时间:2021-07-01 10:21:17 帮助过:6人阅读
用的sqlserver2008 r2。
SELECT * FROM t_class WHERE id IN (SELECT id FROM (SELECT ROW_NUMBER() OVER (PARTITION BY id ORDER BY inserttime) AS rn, id FROM t_class) myclass WHERE rn >= 5) ORDER BY id;看起来好复杂,不知道有没有简单方法。
sqlserver查询某一字段重复超5次的所有记录
标签: