title: How to limit the selection in SQL Server by sum of a column?
body: <p>Can I limit rows by sum of a column in a SQL Server database? </p>
  
  <p>For example:</p>
  
  <pre><code>Type | Time (in minutes)
  -------------------------
  A    | 50
  B    | 10
  C    | 30
  D    | 20
  E    | 70
  ...
  </code></pre>
  
  <p>And I want to limit the selection by sum of time. For example maximum of 100 minutes. Table must look like this:</p>
  
  <pre><code>Type | Time (in minutes)
  -------------------------
  A    | 50
  B    | 10
  C    | 30
  </code></pre>
  
  <p>Any ideas? Thanks.</p>