Hi Team,
I have a table from which I need to find out multiple rejection condition.
I have done following but not satisfied and looking for some good alternative.
declare @tbl table(id int identity , check1 float , check2 float , check3 float)
insert into @tbl (check1, check2,check3)
values(10,15,20),(5,9,8),(2,3,10)
select id , case
when check1<5 and check2<10 and check3 <15 then 'check1 is less than 5 and check2 is less than 10 and check3 is less than 15'
when check1<5 and check2<10 then 'check1 is less than 5 and check2 is less than 10'
when check1<5 and check3<15 then 'check1 is less than 5 and check3 is less than 15'
when check2<10 and check3<15 then 'check2 is less than 10 and check3 is less than 15'
when check1<5 then 'check1 is less than 5 '
when check2<10 then 'check2 is less than 10 '
when check3<15 then 'check3 is less than 15 '
else 'ok'
end
from @tbl