From 0b8113721142214e7e30fae5841175815418ff8d Mon Sep 17 00:00:00 2001 From: krishnachaudhary596 Date: Mon, 27 Feb 2023 13:05:37 +0530 Subject: [PATCH] Added answer of question no 14 --- select-from-nobel.sql | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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,