Subject group by on derived columns
Author Ray Drew
The Interbase docs say...

Each column name that appears in a GROUP BY clause must also be specified in


GROUP BY cannot specify a column whose values are derived from a
aggregate, or user-defined function.

Is this still the case in Firebird 1.0? (it does appear to be)

I have a query that includes the following derived column...

sp.spdate + (7 - extract(weekday from sp.spdate))

...this returns the week ending date for individual dates in the query. I
need to be able to group on this column to generate week ending totals. Is
there a way to do this in a straight select query? I can do it via a stored
proc. but I'm trying to avoid that since my app. code constructs straight
select queries dependent on user choices and I don't want to break that if I
don't have to.

Thanks for any insight,


Do You Yahoo!?
Get your free @... address at