测试日期至现在日期的每日产量之和,三个字段来自同一张表
-- MySQL语法,参考写法:
SELECT
DATE_FORMAT(RQ,"%Y-%m-%d") as t
,sum(TK) as TK
from tabname
where RQ BETWEEN 测试日期 and CURDATE()
group by DATE_FORMAT(RQ,"%Y-%m-%d") -- 每日用水之和,就要考虑分组聚合指标;
-------------------
select sum(产量) from 表 where 日期 between 测试日期 and curdate()