需要找到确切的计数 [英] Need to Find the Exact Count
本文介绍了需要找到确切的计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我正在使用带有各种条件条件的选择查询,并且我将列分组,最后检查正好是2还是3的列的计数.(我尝试过在函数之间且大于函数).我找不到确切的解决方案.
任何人都可以提供解决方案.
Rgds
Jagadesh
Hi all
I am using a select query with various where condition and i am grouping the column finally checking the count of the column for exactly 2 or 3. (i tried on between and greater than functions). I could not find a exact solution.
Can anyone provide a solution.
Rgds
Jagadesh
推荐答案
如果我正确理解了目的:您可以使用具有"子句:
If I correctly understand the purpose: you can either use "having" clause:
select dummy, count(*) from dual
group by dummy
having count(*) between 2 and 3
或者也许使用嵌套的sql-query:
Or maybe use nested sql-query:
select * from
(
select X, count(*) X_Count from Table_1 group by X
)
where X_Count between 2 and 3
这篇关于需要找到确切的计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文