This is the data which I am working on
Declare @mytable TABLE(EmpName varchar(100),MATHS INT,SCIENCE INT)
INSERT INTO @mytable
VALUES('Ram',50,60)
,('Krishna',100,30)
,('Ramesh',90,90)
I wanted to display the cells which satisfy this condition (Maths=90 and Science=90). Do get this I have used the code below:
SELECT EmpName
,CASE WHEN MATHS=90 THEN CASE WHEN SCIENCE =90 THEN 1 ELSE 0 END END
FROM @mytable
Is there any other way to achieve it? if yes please share the code.