title: select id that occur the most
body: <p>I have two tables</p>
  
  <pre><code>Users(user_id, name)            
  
  Competition(comp_id, user_id, score)
  </code></pre>
  
  <p>I need to select user_id that occur the most in competition.
  Can I do it with max(count)?<br>
  Is there any way to get exception if two users have same most occurances?</p>
  
  <p>I tried:</p>
  
  <pre><code>SELECT MAX(numberr), USER_ID 
  FROM ( 
     SELECT USER_ID, COUNT(COMP_ID) AS numberr 
     FROM COMPETITION 
     GROUP BY USER_ID
  ) 
  GROUP BY USER_ID;
  </code></pre>
  
  <p>But result I get is:</p>
  
  <pre><code>MAX(numberr) USER_ID   
  4             1   
  2             2   
  6             3   
  </code></pre>