select s.wkid,s.wkname,t.retime ,t.traffic*60
from river_calresult t,ph_duanm_weikou s
where t.rno=s.dmno and t.overflowflag=3
union
{
select s.wkid,s.wkname,t.retime ,t.traffic*60
from river_calresult t,ph_duanm_weikou s
where t.rno=s.dmno and t.overflowflag=s.shore
group by( s.wkid,s.wkname,t.retime ,t.traffic*60)
}
同时选中,点击运行按钮,就可以执行
select s.wkid,s.wkname,t.retime ,t.traffic*60
from river_calresult t,ph_duanm_weikou s
where t.rno=s.dmno and t.overflowflag=3
union
select s.wkid,s.wkname,t.retime ,t.traffic*60
from river_calresult t,ph_duanm_weikou s
where t.rno=s.dmno and t.overflowflag=s.shore
group by( s.wkid,s.wkname,t.retime ,t.traffic*60)
用union 或 union all将两个SQL串起来
union会消除重复资料
union all不会消除重复资料
使用union all,你可以调试下。