Subject Re: [firebird-support] Group by on a timestamp field
Author Ann W. Harrison
williamvdw2004 wrote:
>
> I am trying get the "messages per minute" rate.
>
> Here is a sample of my current sql statment (which seems to return
> messages per second).
>
> select timesent,count(*) from messages group by timesent
>

Group by works on exact values and time is expressed in seconds.
You'll need to group by an expression ... probably an extract.

e.g,

select extract (year from timesent), extract (yearday from
timesent), extract (hour from timesent), extract (minute from timesent),
timesent,
count(*) from ... group by 1, 2, 3, 4


Regards,


Ann