title: SQL Select until Quantity Met
body: <p>i need a sql query that can show something like this :</p>
  <p>My Data :</p>
  <pre><code>| id | Purchase Number | Qty |
  |:---- |:------:| -----:|
  | 1 | A   | 3 |
  | 2 | B   | 2 |
  | 3 | C   | 4 |
  </code></pre>
  <p>For example i need to take 6 Qty
  I want the result will be like this :</p>
  <pre><code>| id | Purchase Number | Qty |
  |:---- |:------:| -----:|
  | 1 | A   | 3 |
  | 2 | B   | 2 |
  | 3 | C   | 1|
  </code></pre>
  <p>I've read similar thread but cant find what i need</p>