菜鸟跪求SQL解决办法~~救急 (多重条件筛选,累计,量大)
发布网友
发布时间:2022-04-13 11:49
我来回答
共1个回答
热心网友
时间:2022-04-13 13:19
哦,是我疏忽了,tjtime2-tjtime1应该不光<=14,还应该>=0
Creat view 导出信息1 as
select ID, tjtime1, tjtime2, JinE, phone
from t1, t2
where t1.id=t2.id and
tjtime2-tjtime1 between 0 and 14;
create view 导出信息2 as
select id, sum(JinE) as JinE, phone
from 导出信息1
group by id;