I will make a sql statement that retrieves all the images as long as the sum of the size is 100
I have this:
SELECT PhotoNr
INTO # PhotoTabl
FROM Photo
WHERE Size <= 100????
ORDER BY PhotoOrder ASC
Table-Contents:
PhotoNr ...... Size
1 ............ 20
2 ............ 50
3 ............ 20
4 ............ 50
5 ............ 20
The sql will give the result:
PhotoNr ...... Size
1 ............ 20
2 ............ 50
3 ............ 20
Is there any good solution for this?
PhotoOrderper theSELECTorPhotoNrper the example data?