I use SQL inside a 3rd party system (So don't know the type it is) I am trying to make a CASE work on a column using data from 2 more.
I want to display a column call Channel
that is calculated using the following logic:
If column O.Test
is blank and column o.subsource
is not blank, display 'RESEND'
, otherwise display the value of column o.Source
.
This is part of the SQL showing the CASE
I wrote to do this:
select
-- other columns
(CASE
WHEN o.Test = NULL AND o.Subsource IS NOT NULL THEN 'RESEND'
ElSE o.Source
END) o.Source AS 'Channel',
-- other columns
The SQL runs with no errors but the output always shows what is in o.Source
.