title: Highest Matches as an umpire
body: <p>Their are two column umpire1 and umpire 2.</p>
  <p>I need to find the name of the umpire who attend maximum matches doesn't matter he is umpire1 or umpire2 in that match his occurrence should count.</p>
  <p>for e.g-- S Ravi</p>
  <pre><code>37 time as umpire1
  57 time as umpire2
  94 -- total
  </code></pre>
  <p>Output like</p>
  <p>Umpire   Total_count</p>
  <pre><code>S Ravi       94
  </code></pre>
  <p>Error in SQL statement: AnalysisException: cannot resolve '<code>level</code>' given input columns:
  line 2 pos 14;
  'Aggregate [umpire1#2497], [umpire1#2497, 'sum(CASE WHEN ('level = S Ravi) THEN 1 ELSE 0 END) AS u1#2464, 'sum(CASE WHEN ('level = SJ Davis) THEN 1 ELSE 0 END) AS u2#2465, 'sum(('u1 + 'u2)) AS total#2466]</p>
  <pre><code>select umpire1,
  sum(case when level ='umpire1' then 1 else 0 end) as u1,
  sum(case when level ='umpire2' then 1 else 0 end) as u2,
  sum(u1+u2) as total
  from IPL_MATCHES group by umpire1;
  </code></pre>