Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
below sql query is not showing results as expected
SELECT *
FROM Data.CASE
where INCOPE LIKE 'In%' and "Country" in ('china')
and "ENTITY" not In ('BUS', 'BCA','SBC China','SBC Chna',' ')
and NOT ("ENTITY" IS NULL) ;
my requirment is wherever legal entity = 'BUS', 'BCA','SBC China','SBC Chna',' ' and not isnull and country =china data should not shown in dashboard -- china data should not shown in dashboard
but for those legal entity if we have other country it show as it is .
Country | Entity |
china | BUS |
china | BCA |
china | BCA |
US | BCA |
china | SBC China |
china | CHN limited |
china | Unknown |
china | - |
output :
US | BCA |
china | CHN limited |
here is the modified version of your script:-
SELECT *
FROM Data.CASE
WHERE INCOPE LIKE 'In%'
AND (
("Country" = 'china' AND "ENTITY" NOT IN ('BUS', 'BCA', 'SBC China', 'SBC Chna', ' ') AND "ENTITY" IS NOT NULL)
OR ("Country" <> 'china')
);
I hope this helps 🙂