|Subject||Re: [firebird-support] Re: Group by date on a timestamp field|
> >>Thanks Adam! Works great. Why can't I use something like:because Firebird no longer follows the SQL standard in this case :-)
> >>select cast(myfieldname as Date) as SomeName, count(*)
> >>from mytablename
> >>group by SomeName
> > Because expressions in SELECT are calculated after expressions in
> > GROUP BY.
> Then why does this work ??
> select cast(myfieldname as Date), count(*)
> from mytablename
> group by 1
The SQL standard says that a "group by" can only be done on base
table (or view) columns, not derived columns in the resultset.
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Database development questions? Check the forum!