目标是计算表2的每一行,其中key在start-end范围内的value平均值
比如第一行是1,3 表一的KEY=1,2,3 计算AVG(V1+V2+V3)放到表二里
select
b.start,
b.end,
avg(a.value)
from
table1 a,
table2 b
where
a.key between b.start and b.end
group by
b.start,
b.end;
https://blog.csdn.net/gwd1154978352/article/details/78606888