Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. aurora00

    find first n records that adds up to certain amount

    Thank you for the quick response! I use postgre and it works! Unfortunately the performance is also very slow. I wonder if the inner join causes some kind of n^2 behavior.
  2. aurora00

    find first n records that adds up to certain amount

    Let's said I have a table with an id column and an amount column. I want to select the first n records that adds up to certain amount, say 100. Something similar to the SQL below: select id, amount from table order by id limit sum(amount) < = 100 Anyway to do it with SQL?

Part and Inventory Search

Back
Top