string sql="select sum(num)as test,test2,test3 from table where time >'2012-03-02' and time <2012-04-01";怎么把这个时间段内的每一天的数据都查询出来(从三月2号开始 到四月一号的这中间的每一天)?? 而且这里有个求和,请问这个该怎么写?请教各位了
想得到的结果是
03-02 这天 num总和数,test2,test3
03-03 这天 。。。。。。。。。。。
依次下去 直到04-01这天
然后显示绑定到girdview里面
...全文
1236打赏收藏
关于一个循环,一个送分的题目
string sql="select sum(num)as test,test2,test3 from table where time >'2012-03-02' and time <2012-04-01";怎么把这个时间段内的每一天的数据都查询出来(从三月2号开始 到四月一号的这中间的每一天)?? 而且这里有个求和,请问这个该怎么写?请教各位了 想得到的结果是 03-02 这天 num总和数,test2,test3 03-03 这天 。。。。。。。。。。。 依次下去 直到04-01这天 然后
select sum(consume),day([date]) from consume_record where [date] between to_date('2012-03-02','yyyy-mm-dd') and to_date('012-04-01','yyyy-mm-dd') group by day([date])
select sum(num)as test,test2,test3 from table where time >to_date('2012-03-02','yyyy-mm-dd') and time <to_date('012-04-01','yyyy-mm-dd') group by time order by time
[/Quote]
++
select sum(num)as test,test2,test3 from table where time >to_date('2012-03-02','yyyy-mm-dd') and time <to_date('012-04-01','yyyy-mm-dd') group by time order by time