select start, end, avg(value) from (select t2.start, t2.end, t1.value from t1 left join t2 on t1.key between t2.start and t2.end ) as x group by start,end;效果见下图:
mysql语句 查询求平均
select start, end, avg(value) from (
select t2.start, t2.end, t1.value from t1 left join t2 on t1.key between t2.start and t2.end
) as x group by start,end;
效果见下图:
2020-09-28