Subject Re: [SPAM 5] Re: [firebird-support] Group by month based on a timestamp?
Author Kjell Rilbe
Thomas Steinmaurer skriver:
>
> > I've got data in a table containing timestamps in a timestamp column. I
> > want to group these by month.
> >
> > How?
> >
> > Anything simpler/better than this:
> > substring(cast(T."TheTimestamp" as varchar(50)) from 1 for 7)
>
> select
> count(*)
> , extract(month from mytimestamp)
> from
> t
> group by
> extract(month from mytimestamp)
>
Ah, sorry, I meant group by year + month. But I guess I can figure it
out. :-) Thanks!

Kjell

--
------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64



[Non-text portions of this message have been removed]