title: Select top X from table where SUM(column) <= @variable
body: <p>I'm trying to select the top n number of rows where the sum of a column is less than or equal to a number i pass in as a variable.</p>
  
  <p>TableX:</p>
  
  <pre><code>Col1  Col2
  1     10
  2     10
  3     5
  4     20
  </code></pre>
  
  <p>So basically i'm trying to do something like this:</p>
  
  <pre><code>SELECT * FROM TableX WHERE SUM(Col2) &lt;= 25
  </code></pre>
  
  <p>And I would be expecting the result:</p>
  
  <pre><code>Col1  Col2
  1     10
  2     10
  3     5
  </code></pre>