select-until

SQL: Select "until"

I'm looking for a way to select until a sum is reached. My "documents" table has "tag_id" and "size" fields. I want to select all of the documents with tag_id = 26 but I know I can only handle 600 units of size. So, there's no point in selecting 100 documents and discarding 90 of them when I could have known that the first 10 already ...

Select from MySQL records that sums

Hello. I know there are a few post out here about selecting records until a certain number is met from the sum of one field but there isn't any that suits me. I'm using PHP and MySQL. I have a table named quantity. Inside there are records of product name, product price and product quantity. Besides these, there are a few others that he...