14,494 questions
Try:
select ROW_ID, CODE, case when CODE = 'SMG_TH/N' and TYPE_NUM = 1 then 2 else TYPE_NUM end as TYPE_NUM
from MyTable
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear experts,
based on the below data, Instead of updating data. I want to handle these in case statements.
IF CODE= SMG_TH/N then show type_num=2 instead of 1
Try:
select ROW_ID, CODE, case when CODE = 'SMG_TH/N' and TYPE_NUM = 1 then 2 else TYPE_NUM end as TYPE_NUM
from MyTable