OR condition not working correctly in SQL
SuzieJan 3 2008 — edited Jan 3 2008I 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...