Hvis disse virkelig opdateres hver dag, så brug dato-aritmetik:
SELECT bline_id, AVG(flow) as flowavg
FROM blf
WHERE bline_id BETWEEN 1 AND 30 and
date >= date_sub(now(), interval 10 day)
GROUP BY bline_id
ORDER BY bline_id ASC
Ellers skal du indsætte en tæller, hvilket du kan gøre med en korreleret underforespørgsel:
SELECT bline_id, AVG(flow) as flowavg
FROM (select blf.*,
(select COUNT(*) from blf blf2 where blf2.bline_id = blf.bline_id and blf2.date >= blf.date
) seqnum
from blf
) blf
WHERE bline_id BETWEEN 1 AND 30 and
seqnum <= 10
GROUP BY bline_id
ORDER BY bline_id ASC