user1384356
user1384356

Reputation: 7

How to write select Statement based on score column result using SQL server?

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

Answers (1)

juergen d
juergen d

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

Related Questions