ORA-000920 Error for Query

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
                UNION ALL 
                SELECT 		ice2.*, 
                            2 AS domain
                FROM        ice2.base ice2)
    WHERE      key_type    IN (1,2,14,15)
    AND        (product_status ='LI'                OR  (product status ='PL'
                                                         AND start_date<SYSDATE)
                OR  (product_status ='PG'
                   AND start_date>SYSDATE));

Open in new window

SimpleIntelligenceAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
SimpleIntelligenceConnect With a Mentor Author Commented:
Same error - invalid relational operator
0
 
Om PrakashCommented:
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
                UNION ALL  
                SELECT          ice2.*,  
                            2 AS domain
                FROM        ice2.base ice2)
    WHERE      key_type    IN (1,2,14,15)
    AND        
    ((product_status ='LI') OR  (product status ='PL' AND start_date<SYSDATE) OR  (product_status ='PG' AND start_date>SYSDATE));
0
All Courses

From novice to tech pro — start learning today.