Subject | Re: [firebird-support] Re: extract(week from d) |
---|---|
Author | Ivan Prenosil |
Post date | 2006-11-30T13:16:42Z |
> but I want make select like this (weekly summary) :So, you actually do not need the week number,
>
> select extract(week from datum) as w, sum(some_data) as total
> from t
> where ...
> GROUP BY extract(week from datum)
but just to group by weeks sequentially, do you ???
Try this
select (datum - date'1900-1-1')/7, sum(some_data) as total
from t
where ...
GROUP BY (datum - date'1900-1-1')/7
Ivan
http://www.volny.cz/iprenosil/interbase/