CASE expression look like switch statements as in programming languages.
Example: Categorize students according to their exam grades.
SELECT
studentName,
CASE
WHEN studentGrade < 50 THEN 'Weak'
WHEN studentGrade < 90 THEN 'Good'
WHEN studentGrade < 100 THEN 'Well'
END FROM studentGrades
No comments:
Post a Comment