Jump to content

Help with where close


DerAdler
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...