卖 卖女孩的小火柴之二 Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-20 #1 假设有表有两个字段,一个是时间,一个是数量,我怎么统计出一年中每一周的数量和,也就是按周一道周六的数据求和(周日没有数据)。这个SQL语句怎么写,或者能用什么方法实现。
S szhcracker Unregistered / Unconfirmed GUEST, unregistred user! 2009-04-20 #3 如MySQL里面可以用:SELECT WeekDay(fdatetime), Sum(sl) sl From table1Where fdatetime Between '2008-01-01 00:00:00' and '2008-12-31 23:59:59'Group By WeekDay(fdatetime)你可以参考参考。
如MySQL里面可以用:SELECT WeekDay(fdatetime), Sum(sl) sl From table1Where fdatetime Between '2008-01-01 00:00:00' and '2008-12-31 23:59:59'Group By WeekDay(fdatetime)你可以参考参考。