While I can certainly see the value of going with what PostgreSQL and SQL 
Server do on the ORDER BY issue, I have to say that I suspect that Oracle's 
behavior here seem more in line Principle of Least Astonishment. First, because 
ORDER BY generally works on the resultant relation, and second, the same 
expression (say lower(m)) in GROUP BY and ORDER BY can have different values in 
the same SELECT statement with that logic.  But I admit it isn't a big deal as 
long as it is properly documented.  Really, using a column alias that is the 
same as an actual base column isn't a particularly clever thing to do in the 
first place, even if legal.
 
Peter

From: Richard Hipp <[email protected]>
>To: Peter Aronson <[email protected]>; General Discussion of SQLite Database 
><[email protected]> 
>Sent: Wednesday, August 14, 2013 2:05 PM
>Subject: Re: [sqlite] name resolutionn in GROUP BY
>
>
>
>On Wed, Aug 14, 2013 at 5:02 PM, Peter Aronson <[email protected]> wrote:
>
>If I understand Dominique's post, Oracle works like SQLite 3.7.15 as well.  
>Things only got confusing when we moved from discussing GROUP BY to discussing 
>ORDER BY for some reason.
>>
>
>There are two separate (though related) issues:
>
>     http://www.sqlite.org/src/info/1c69be2daf
>     http://www.sqlite.org/src/info/f617ea3125
>
>
>Oracle is the outlier on the second of the two.
>
>
>-- 
>D. Richard Hipp
>[email protected] 
>
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to