Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OR condition not working correctly in SQL

SuzieJan 3 2008 — edited Jan 3 2008
I am adding the folling condition to a sql statement and

AND (status_code IS NULL or status_code <> 'T'
or (status_code IN ('A','B','C','D') and TRIM(order_type) NOT LIKE '%9999')
or (status_code IN ('A','B','C','D') and order_type IS NOT NULL)
or (status_code NOT IN ('A','B','C','D')))

but the or condition work...

if i change it too

AND ( (status_code IN ('A','B','C','D') and order_type IS NOT NULL) )

then this portion of the OR condition work but when I use the OR condition something weird is happening that the condition not working... and i dont see a record that meets that condition...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 31 2008
Added on Jan 3 2008
10 comments
523 views