I want my filter to say
Where it is LI
or where it is PL and hasn't occurred yet
or where it is PG and has occurred
I'm putting the brackets in wrong. Please advise.
SELECT account_reference, key_type, ice_customer_id, base_id, premise_id, base_type, start_date, end_date, product_status, end_reason, domain
FROM (SELECT ice1.*,
1 AS domain
FROM ice1.base ice1
2 AS domain
FROM ice2.base ice2)
WHERE key_type IN (1,2,14,15)
AND (product_status ='LI' OR (product status ='PL'
OR (product_status ='PG'