On 14/12/2007, at 3:40 AM, [EMAIL PROTECTED] wrote:

Ticket number #2822

http://www.sqlite.org/cvstrac/tktview?tn=2822


(2)  If an ORDER BY term is a simple identifer
     (like "x", not "x.y" and not "x.y.z") and if
     there if the k-th column uses that same identifer
     as an AS alias, the sort by the k-th column.


CREATE TABLE a(x,y);
 INSERT INTO a VALUES(1,8);
 INSERT INTO a VALUES(9,2);

 SELECT x AS y FROM a ORDER BY y;

In older versions of SQLite, the SELECT statement above
would return 9, 1 since the ORDER BY term evaluated to
the expression a.y by rule (3)  In the next release,
because of the addition of rule (2) above, the result
will be 1, 9.


I don't understand. If I say "ORDER BY y" aren't I saying sort the result set based on the column " as y" of the result set, not the table "a.y"?
ie they should come out

y
9
1



That's what (2) says to me

Cheers.

--

Dr Gerard Hammond
http://www.macsos.com.au









Cheers.

--

Dr Gerard Hammond
http://www.macsos.com.au









Cheers.

--

Dr Gerard Hammond
Garvan Institute of Medical Research






-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to