title: Mysql query that can search with a criteria of total summation of an object
body: <p>hello please help me with this mysql query,</p>
  
  <p>i want to select the rows that have a summation of 17 or less when the quantity columns is added together and the searched item is Pen in an ascending order based on id.</p>
  
  <p>My table structure is like this:</p>
  
  <pre><code>ID quantity item 
  ------------------
  1         5 Pen
  2         3 Pen
  3        10 Books
  4         7 Pen
  5         4 Pen
  6         8 Pen
  7         1 Rubber
  </code></pre>
  
  <p>so i want my output to be like this, because when the quantity is added together for the pen that can be equal to 17, it will have the below rows</p>
  
  <pre><code>ID quantity item 
  ------------------
   1        5 Pen 
   2        3 Pen
   4        7 Pen
   5        4 Pen
  </code></pre>
  
  <p>Thank you in advance.</p>