Subject | Re: [firebird-support] What's wrong with this SQL? |
---|---|
Author | Norman Dunbar |
Post date | 2011-09-20T09:08:58Z |
Morning all,
On 20/09/11 09:25, Kjell Rilbe wrote:
> ...
> I was under the impression that the query parser would recognize that
> the two expressions are identical. That's actually how it works in SQL
> Server 2008. In fact, there you HAVE to use that syntax; you CANNOT
> refer to the select list's column alias in the group by clause. I wasn't
> aware that SQL Server and Firebird are different in this respect.
Ditto Oracle. You must repeat the selected expression in the group by
clause, you cannot use an alias or a column position. Having said that,
I much prefer the Firebird method!
> ...
>> You will get the groups in order anyway, so you don't actually need the
>> ORDER BY clause.
> But this is just an implementation artefact, isn't it? Not something
> that's actually defined in the language?
Again, in Oracle, it is not necessarily true that a group by implies the
same order by. It used to - up to version 9i if I remember correctly -
but not any longer.
Just an observation.
Cheers,
Norm.
--
Norman Dunbar
Dunbar IT Consultants Ltd
Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
West Yorkshire
United Kingdom
LS28 7EL
Company Number: 05132767