title: Apex Report: "query column is invalid, use column alias"
body: <p>I am receiving an error stating:</p>
  
  <blockquote>
    <p>query column #4 (DECODE(A.SUBMISSION_TYPE,'D','DIGITALSUBMISSION','S','SUBMISSIONLOG','M','MAIL')) is invalid, use column alias</p>
  </blockquote>
  
  <p>and I don't know how to fix it.</p>
  
  <pre><code>select a.phase,a.st_code||' - '||b.state_name,
  a.submission_received_dt,
  DECODE (a.submission_type,'D','Digital Submission','S','Submission Log', 'M', 'Mail'),
  a.no_change_dt
  from pcspro.sdrp15_return a, pcspro.sdrp15_states_ready b 
  where a.phase = b.phase and a.st_code = b.state;
  </code></pre>