Hi, @Shambhu Rai Please share additional information if the above-provided solution does not meet the expected ouput.
Regards
Geetha
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Expert,
the below is the condition
case when oid= 'Winter' then Name else 'noname'
create table table1(id varchar(30), name varchar(30), oid varchar(30))
insert into table1 values('1', 'David', 'Winter')
insert into table1 values('2', 'Hash', 'Winter')
insert into table1 values('3', 'Steve', 'Autumn')
Expected output
('1', 'David', 'Winter')
('2', 'Hash', 'Winter')
('3', 'noname', 'Autumn')
Hi, @Shambhu Rai Please share additional information if the above-provided solution does not meet the expected ouput.
Regards
Geetha
Hi @Shambhu Rai
Please check this query:
SELECT id,CASE WHEN oid = 'Winter' THEN name ELSE 'noname' END AS Name,oid
FROM table1
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.