Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我有这个查询,它给了我一个 id 的列表和他们在特定表中重复的次数的计数。尽管该表很大,但我无法弄清楚如何计算查询返回的行数。
我尝试在表和“IN”子句上进行自连接,但无法让它们工作
有什么想法吗?
select id, count(*) as C from tblProduct group by id having count(*) > 2 order by C desc
select count(*) from (select id, count(*) as C from tblProduct group by id having count(*) > 2 ) mytable