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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
SimpleIntelligenceAuthor Commented:
Same error - invalid relational operator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.