SQL 选择多个条件/标准的计数
这是我正在使用的表和数据:
表名称:Customer_Table
Column 1<Product> Column 2<Region> Column 3<Customer Status>
EB1 AUSTRALIA CUSTOMER
PS2 NEW ZEALAND CUSTOMER
EB1 AUSTRALIA CUSTOMER
PS2 NEW ZEALAND DUPLICATE
PS2 NEW ZEALAND CUSTOMER
PS2 NEW ZEALAND CUSTOMER
EB1 AUSTRALIA
EB1 AUSTRALIA DUPLICATE
EB1 AUSTRALIA DUPLICATE
EB1 AUSTRALIA DUPLICATE
我在追求什么?
我正在尝试计算单个值 在哪里
- 第 1 列 = EB1
- 第 2 栏 = 澳大利亚
- AND 第 3 列排除所有重复项,但计算空值
最终结果应为= 3
This is the Table and Data I am using:
Table Name: Customer_Table
Column 1<Product> Column 2<Region> Column 3<Customer Status>
EB1 AUSTRALIA CUSTOMER
PS2 NEW ZEALAND CUSTOMER
EB1 AUSTRALIA CUSTOMER
PS2 NEW ZEALAND DUPLICATE
PS2 NEW ZEALAND CUSTOMER
PS2 NEW ZEALAND CUSTOMER
EB1 AUSTRALIA
EB1 AUSTRALIA DUPLICATE
EB1 AUSTRALIA DUPLICATE
EB1 AUSTRALIA DUPLICATE
What am I after?
I am trying to calculate a single value
where
- Column 1 = EB1
- AND COLUMN 2 = Australia
- AND Column 3 Excludes all duplicates but counts nulls
The final result should be= 3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
use