DerAdler Posted September 30, 2019 Share Posted September 30, 2019 I am trying to filter duplicates out in OPERATION_TYPE by 2 values (X,I). Possible choices are X, I and NULL. I want to return "I" when "X" is NULL ELSE "X". This is what I have: SELECT * FROM TABLE WHERE OPERATION_TYPE = 'X' OR OPERATION_TYPE = 'I' AND OPERATION_TYPE = 'X' IS NULL Which only gives me "I" Link to comment Share on other sites More sharing options...
justsomeguy Posted October 2, 2019 Share Posted October 2, 2019 Use parentheses to separate the AND and OR conditions. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now