title: Using 'case expression column' in where clause
body: <pre><code>SELECT ename
    ,    job
    ,    CASE deptno
           WHEN 10
             THEN 'ACCOUNTS'
           WHEN 20
             THEN 'SALES'
           ELSE 'UNKNOWN'
         END AS department
  FROM emp /* !!! */ 
  WHERE department = 'SALES'
  </code></pre>
  
  <p>This fails:</p>
  
  <blockquote>
    <p>ORA-00904: "%s: invalid identifier" </p>
  </blockquote>
  
  <p>Is there a way to overcome this limitation in Oracle 10.2 SQL ?
  How to use the 'case expression column' in where clause ?</p>