Case statement with multiple conditions in SQL Server

Last Reply 10 months ago By chetan

Posted 10 months ago

Is it possible to combine this two into one?

 cmp.category=case when cmp.category='' OR cmp.category IS NULL OR cmp.category IS NOT NULL then dupl.category else cmp.category end,
 cmp.category=case when cmp.status!=1 and cmp.status!=2 then dupl.category else cmp.category end,

 

You are viewing reply posted by: chetan 10 months ago.
Posted 10 months ago

i got the solution SIr from ur reference:

 

 cmp.category=case when cmp.status!=2 and (cmp.category='' OR cmp.category IS NULL OR cmp.category IS NOT NULL) then dupl.category else cmp.category end

This worked for me.