filtering "distinct" values count from the output
Posted: Wed Aug 07, 2013 11:23 am
Hi
the below rule
col0="orange"
and col1="apple"
and col2 ="fruits"
output
====
shopname, col0, col1, col2
xxxx,orange, apple, fruits
xxxx,orange, apple, fruits
yyyy,orange, apple, fruits
yyyy,orange, apple, fruits
yyyy,orange, apple, fruits
produces a list of all the records matches the condition, but the output result contains a lot of duplicates on a particular column ( for example column name "shopname" ), if i want to produce a row count of only the unique records from column "shopname" satisfying the above rule,
anyway to do that in IA
select count(distinct shopname)
from table1
where col0="orange"
and col1="apple"
and col3="fruits"
cheers
Mj
the below rule
col0="orange"
and col1="apple"
and col2 ="fruits"
output
====
shopname, col0, col1, col2
xxxx,orange, apple, fruits
xxxx,orange, apple, fruits
yyyy,orange, apple, fruits
yyyy,orange, apple, fruits
yyyy,orange, apple, fruits
produces a list of all the records matches the condition, but the output result contains a lot of duplicates on a particular column ( for example column name "shopname" ), if i want to produce a row count of only the unique records from column "shopname" satisfying the above rule,
anyway to do that in IA
select count(distinct shopname)
from table1
where col0="orange"
and col1="apple"
and col3="fruits"
cheers
Mj