Skip to content
Advertisement

Where In SQL Oracle

I have one question, I am trying to make one WHERE statement in Oracle SQL.

As result for the TARGET_ADDRESS column, I need the value from this column only if ENTRY_POINT = +322012345, otherwise it should be null.

table data

Is it possible? It’s possible to used CASE but I want keep my column TARGET_ADDRESS.

Advertisement

Answer

If I understand correctly, the following CASE expression should work:

SELECT t.*, CASE WHEN ENTRY_POINT = '+322012345' THEN TARGET_ADDRESS END AS TARGET_ADDRESS
FROM yourTable t;
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement