Reputation: 7
Actually my requirement is somthing like below I need to get student details with score and result Condition: if score is more than 70 then result will be pass or else fail score column can get from DB based on score need to find out result
Upvotes: 0
Views: 124
Reputation: 204854
SELECT s.*, case when score is null
then '--'
when score > 70
then 'pass'
else 'fail'
end as result
from students s
Upvotes: 2