title: Msg 8120, Level 16, State 1, Line 5 Column is invalid in the select list because it is not contained error
body: <blockquote>
    <p>Msg 8120, Level 16, State 1, Line 5
    Column is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.</p>
  </blockquote>
  
  <p>This seems like quite the common error but every result that I look up has a group by clause or statement. My example does not. Below is the code used. Any ideas as to how to resolve this error?</p>
  
  <pre class="lang-sql prettyprint-override"><code> select year, qtr, area, industry, ownership, employment
   from indstry
   where ( area = '32001' or area = '32005' or area = '32007' or area = 
   '32009' or area = '32011' or area = '32013' or area ='32015' or area = 
   '32017' or area = '32019' or area = '32021' or area = '32023' or area = 
   '32027' or area = '32033' ) and year ='2016'
   union all
   select year, NULL as qtr, '99999' as Area, NULL as industry, NULL as 
   ownership, sum (employment) as employment
   From industry
   where ( area = '32001' or area = '32005' or area = '32007' or area = 
   '32009' or area = '32011' or area = '32013' or area ='32015' or area = 
   '32017' or area = '32019' or area = '32021' or area = '32023' or area = 
   '32027' or area = '32033' ) and year ='2016'
  </code></pre>