Quantcast
Channel: Questions in topic: "distinct"
Viewing all articles
Browse latest Browse all 38

count distinct number from only one source

$
0
0
I have a orders table which has order number and where the order is generated from. The order number field has duplicate records and the source field can be from multiple files. I want to count distinct number of orders which generated from only one source. If an order generated from two source then I want to discard that. I tried the below code but it returned the distinct order number with other sources as well. Select count(distinct orderNum) from tableName where source=’FileName’

Viewing all articles
Browse latest Browse all 38

Trending Articles