Oracle 10g中如何统计表中某一列的不同值?
我遇到一种情况,我必须计算表的一列中相同类型的字符串数量,例如。一列的值如下:-
apple,apple,apple,orange,orange,banana,banana,banana,banana
所以我需要计算相同类型的所有字符串,这意味着查询应该给出苹果的计数结果 3,橙子 2 个,香蕉 4 个。
偶像可以查询什么?
I have a situation where i have to count number of strings of same type in one column of a table, for eg. a column would be having values such as :-
apple, apple, apple, orange,orange, banana, banana, banana, banana
So i need to count all the strings of same type, that means query should give count result 3 for apples, 2 for oranges and 4 for banana.
What can be idol query for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来你想要一个
GROUP BY
It sounds like you want a
GROUP BY
您可以使用 GROUP BY -
这将为您提供该列中有多少个苹果、橙子、香蕉的结果
You can use GROUP BY -
This will give you the results of how many apples, orange, banana are there in that column
我的需要是具有不同值的同一列的计数
My need was count of same column with different values