I am trying to get the count of distinct people of the shaded region.
Table structure is as follows:
customer key
A234 1
A345 4
A12 5
A989 6
HIVE Query:
select count(distinct(a.customer))
from (
select *
from cust
where key in (1,2,3)) c
left outer join (
select *
from cust
where key in (4,5)) a on a.customer= c.customer where c.customer is null
join
(select *
from cust
where key in (6,7,8,9)) d on c.customer = d.customer and d.customer is null;
Error:
missing EOF at 'join' near 'null'