title: Why is this SQL giving column cannot be resolved error?
body: <p>I am trying to run a very simple <code>CASE...WHEN</code> statement:</p>
  
  <pre><code>SELECT userid, sum(end_time-start_time)/60 AS timespent_minutes, 
                      CASE WHEN webid = '324234' THEN 'CA'
                      ELSE 'Other' END AS storeloc
  FROM time_spent_intervals
  WHERE (ds = '2018-12-01')
  GROUP BY userid, storeloc
  </code></pre>
  
  <p>But I'm getting the following error:</p>
  
  <blockquote>
    <p>Error: SYNTAX_ERROR<br/>
    line 6:38: Column 'storeloc' cannot be resolved</p>
  </blockquote>