Anda ingin menambahkan total berjalan, dan membatasi berdasarkan itu, berikut ini akan berfungsi:
SET @runtot:=0;
SELECT
q1.t,
q1.s,
(@runtot := @runtot + q1.s) AS rt
FROM
(SELECT Date AS t,
SIZE AS s
FROM Table1
ORDER BY Date
) AS q1
WHERE @runtot + q1.s <= 20
Sunting:Demo di sini - SQL Fiddle