-
Sleeper: Decode function
Hi,
I am trying to write a decode function and I want to say "if the column 1 contains 100 in row 5 and the column 2 contains the word CAT then return the amount in column 6.
If I remember rightly the decode function would have a || in it somewhere but I can't remember. Can someone help. I am querying an Oracle database using SQL.
Thanks
Ian
-
I am not familiar with Oracle Syntax...(SQL Server doesn't have that function that I am familar with)
In SQL you could do a Case..When operation
Code:
Select Column6
FRom [Table]
Where COlumn 1 = 100 and column2 = 'CAT'
Or
Code:
Select (Case When Column1 = 100 and column2 = 'CAT' then Column6 else NULL end)
FROm [Table]