title: How to select single row with max count using group by when multiple rows with same count exist
body: <p>I have a relatively simple table but am running into an issue on how to select distinct values with max count.</p>
  <p><a href="https://i.stack.imgur.com/E7UFP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E7UFP.png" alt="enter image description here" /></a></p>
  <p>Above is an example of a single ID in the table (ID, VARIANT, Count). Do note that multiple IDs exist (so imagine 811, 812, etc. all with different 2 char values for VARIANT).</p>
  <p>I need to select a <strong>s%</strong> and <strong>n%</strong> VARIANT (i.e. sb or s2 or s1) with the max count value. The problem is that I can't just group by VARIANT as I need to select both ID and VARIANT for joining to another table.</p>
  <p>I.e. for example, one viable result from the picture above is row 1 and row 3 being returned, or row 1 and row 4, or row 2 and row 3.</p>
  <p>What is the best way to go about this?</p>