I am a novice to SQL Server, so this is probably a really easy problem
to fix. I'm translating an Oracle query and need to change the
'decode' to something compatible. Everything I've read points me to
using 'case' but no matter how I write it I can't get it to work and
get a syntax error. Suggestions?
select SYST CTR
, isnull(substrin g(CD_A, 1, 3), ' ') RESCODE
, DES DESCRIPTION
, decode (substring(CD_A , 1, 3), CODE,PRICE,0) UNIT_PRICE
, count (distinct OR_NO) QTYW
to fix. I'm translating an Oracle query and need to change the
'decode' to something compatible. Everything I've read points me to
using 'case' but no matter how I write it I can't get it to work and
get a syntax error. Suggestions?
select SYST CTR
, isnull(substrin g(CD_A, 1, 3), ' ') RESCODE
, DES DESCRIPTION
, decode (substring(CD_A , 1, 3), CODE,PRICE,0) UNIT_PRICE
, count (distinct OR_NO) QTYW
Comment