W
wy91267
Unregistered / Unconfirmed
GUEST, unregistred user!
select bz ,sum(worknum) worknum from accv_worktime4<br>where worknum>0 and workdate>='2007-09-01' and workdate<='2007-09-21'<br>group by bz order by worknum desc<br>这个代码是算出 2007-09-01到2007-09-31这个时间段 bz 这个字段的 合计 worknum<br>但是我想在要个字段workdate,我怎么写SQL语句呢?不能下面这样写 算出来的合计就不对了<br>select workdate,bz ,sum(worknum) worknum from accv_worktime4<br>where worknum>0 and workdate>='2007-09-01' and workdate<='2007-09-21'<br>group by workdate,bz order by worknum desc