title: SQLZOO SELECT from nobel #14
body: <p>I don't know how to order the names after I sorted out the subject physics and chemistry!</p>
  
  <blockquote>
    <p>Question: The expression subject IN ('Chemistry','Physics') can be
    used as a value - it will be 0 or 1.</p>
    
    <p>Show the 1984 winners and subject ordered by subject and winner name;
    but list Chemistry and Physics last.</p>
  </blockquote>
  
  <pre><code>SELECT winner, subject, subject IN('Physics', 'Chemistry')
  FROM nobel
  WHERE yr=1984
  ORDER BY CASE
   WHEN subject IN ('Physics', 'Chemistry') = 0 THEN subject IN ('Physics', 'Chemistry')
   WHEN subject IN ('Physics', 'Chemistry') =  THEN winner
   ELSE winner 
  End
  </code></pre>
  
  <p>url to problem for more details <a href="http://sqlzoo.net/wiki/SELECT_from_Nobel_Tutorial" rel="noreferrer">http://sqlzoo.net/wiki/SELECT_from_Nobel_Tutorial</a></p>