title: How to select row with same id and add its field value
body: <p>I have table medicine record with fields </p>
  
  <pre><code>Name  qunty    min    expiry
  a       2       3     14/2/2012
  b       4       1     15/12/2010
  a       5       3     16/5/2012
  </code></pre>
  
  <p>I have to select medicine which has  qunty less than min value . Two rows can exist with same name but with different expiry . So in that condition i have to add qunty of same name row and than match with min value . </p>