title: My sql query to get middle row values using GROUP BY function
body: <p>My database structure is like</p>
  
  <pre><code>Id     Price     Code
  1      0.12      93
  2      0.13      93
  3      0.54      93
  4      0.96      93
  5      0.10      94
  6      0.30      94
  7      0.90      94
  8      1.40      94
  9      2.30      94
  </code></pre>
  
  <p>I have to fetch the data using group by code and i want the middle row as output.
  In the above example i want the output as</p>
  
  <pre><code>Id     Price     Code
  3      0.54      93
  7      0.90      94
  </code></pre>
  
  <p>The above is the output that i want with the middle row or the row having maximum price value in case of two middle rows like in case of row count 4,6,8</p>