title: Update columns based on order of another column grouped by another column in MySQL
body: <p>This is my table:</p>
  
  <p><a href="https://i.stack.imgur.com/L1zJs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L1zJs.png" alt="enter image description here"></a></p>
  
  <p>I need to update this table with an update query such that, after the update query my table should be:</p>
  
  <p><a href="https://i.stack.imgur.com/thtWm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/thtWm.png" alt="enter image description here"></a></p>
  
  <p>i.e) for a common_id I need to update the position starting from 1 by ordering the position for that common_id.</p>
  
  <p>This is just a sample table. My actual table has millions of entries.</p>