Subject AW: [firebird-support] Problem grouping and sorting
Author Olaf Kluge
Hello,



ORDER BY <ordinal-number> now causes SELECT * expansion

When columns are referred to by the "ordinal number" (degree) in an ORDER BY
clause, when the output list uses SELECT * FROM ... syntax, the column
list will be expanded and taken into account when determining which column
the number refers to.

This means that, now, SELECT T1.*, T2.COL FROM T1, T2 ORDER BY 2 sorts on
the second column of table T1, while the previous versions sorted on T2.COL.


This brings me a syntax error and does not work in MS Access over ODBC.



I have a solution; I switched the both "group by" statements and now do
firebird sorting the second column.



Thank you for your help.



Have a nice weekend!







Olaf,

> in Firebird 1.5 this is not a problem:
>
>
>
> SELECT TLIEFERANTEN.LIID, TLIEFERANTEN.FIRMA
>
> FROM TLIEFERANTEN
>
> GROUP BY TLIEFERANTEN.LIID, TLIEFERANTEN.FIRMA
>
> ORDER BY TLIEFERANTEN.FIRMA;
>
>
>
> Since Firebird 2 I got an error message .. Ambiguous field name between a
> field and a field in select list.

This is a well-documented compatibility "issue".

I would recommend that you study the release notes. Helen did a great
job to outline compatibility issues in a separate chapter.

--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene <http://www.upscene.com> com



Internal Virus Database is out of date.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.5.3/1564 - Release Date: 21.07.2008
06:42
Internal Virus Database is out of date.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.5.3/1564 - Release Date: 21.07.2008
06:42


[Non-text portions of this message have been removed]