diff --git a/select-from-nobel.sql b/select-from-nobel.sql index 9e15cba..cadcb39 100644 --- a/select-from-nobel.sql +++ b/select-from-nobel.sql @@ -119,7 +119,12 @@ The expression subject IN ('Chemistry','Physics') can be used as a value - it wi Show the 1984 winners ordered by subject and winner name; but list Chemistry and Physics last. */ -SELECT winner, subject, subject IN ('Physics','Chemistry') +SELECT winner, subject FROM nobel -WHERE yr=1984 -ORDER BY subject IN ('Physics','Chemistry'),subject,winner +WHERE yr = 1984 +ORDER BY + CASE + WHEN subject IN ('Chemistry', 'Physics') THEN 1 + ELSE 0 + END ASC, + subject ASC,