Subject Re: [firebird-support] Groupby on date
Author Aage Johansen
Chad Z. Hower wrote:
> :: Is the table growing and growing and you still want to group
> :: by month, not depending on what year it is?
>
> Actually yes year would be part of it.
>
> :: SELECT
> :: EXTRACT(MONTH FROM FieldTimeStamp),
>
> This was exactly my plan and how Im doing it now. But will Extract use an
> index? Also I might need to group by year and month in some cases where the
> criteria might extend beyond 12 months.


An index (on FieldTimeStamp) might help when you add a WHERE clause:
select extract(month from FIELDTIMESTAMP), ...
where FIELDTIMESTAMP between :TS1 and :TS2
...

--
Aage J.