select sum(select * from tableA where SD_QD > 0),sum(select * from tableA where SD_QD < 0) from tableA
这条sql语句不对啊麻烦你调试看一下
select '0-2' as "时间", sum(select SD_QD from tableA where SD_QD > 0 and time between 0 and 2) as "大于0", sum(select SD_QD from tableA where SD_QD < 0 and time between 0 and 2) as "小于0" from tableA until all select '2-4' as "时间", sum(select SD_QD from tableA where SD_QD > 0 and time between 2 and 4) as "大于0", sum(select SD_QD from tableA where SD_QD < 0 and time between 2 and 4) as "小于0" from tableA可能语句会过不去,你自己看着改改,基本语法基本给你写好了。 没人有时间帮你调试,你如果一点手都不动,是什么也学不到的
'0-2' as "时间",
sum(select SD_QD from tableA where SD_QD > 0 and time between 0 and 2) as "大于0",
sum(select SD_QD from tableA where SD_QD < 0 and time between 0 and 2) as "小于0"
from tableA
until all
select
'2-4' as "时间",
sum(select SD_QD from tableA where SD_QD > 0 and time between 2 and 4) as "大于0",
sum(select SD_QD from tableA where SD_QD < 0 and time between 2 and 4) as "小于0"
from tableA可能语句会过不去,你自己看着改改,基本语法基本给你写好了。
没人有时间帮你调试,你如果一点手都不动,是什么也学不到的