title: Case statement within select case statement
body: <p>I am trying to create a <code>case</code> statement to work but I seem to be messing up the syntax somehow. Here is what I have so far:</p>
  
  <pre><code>SELECT lp.assign_date, CASE WHEN lp.assign_date &gt; '01-JAN-13' 
  THEN
    (select count(*) &gt; 0 THEN 'BAD' ELSE 'GOOD' END
     FROM transaction_table
     WHERE ACCOUNT = :V_ACCT
     AND transaction_date &lt; :V_TRAN_DATE
     AND transaction_code = :V_TRAN_CODE 
     AND :V_TRAN_CODE IN (1,6,25)
     AND attorney_id = :V_ATTY_ID)
  ELSE
    (SELECT
     function_legal_chk(:V_ACCT, :V_TRAN_DATE)
     FROM dual)
  FROM legal_placement lp;
  </code></pre>
  
  <p>Essentially its checking to see if the assigned date is after January, if it is then do the next <code>case statement</code> else do the <code>function</code>.</p>
  
  <p>Here is the error that I am receiving:</p>
  
  <pre><code>ORA-00923: FROM keyword not found where expected
  00923. 00000 -  "FROM keyword not found where expected"
  </code></pre>
  
  <p>From what I know and research that I've done on <code>case statements</code>, my syntax seems to be correct but I am not sure if a <code>case</code> within a <code>case</code> is something that can be done.</p>
  
  <p>Any help is much appreciated.</p>