Subject | Re: [SPAM 5] Re: [firebird-support] Group by month based on a timestamp? |
---|---|
Author | Kjell Rilbe |
Post date | 2011-12-15T14:28:22Z |
Thomas Steinmaurer skriver:
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]
>Ah, sorry, I meant group by year + month. But I guess I can figure it
> > 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)
>
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]