On 14 Aug 2013, at 7:13pm, Peter Aronson <pbaron...@att.net> wrote: > I dug out my copy of THE GUIDE TO THE SQL STANDARD, 4th Edition, by Date and > Darwen, and it states (in a footnote on page 151) that name specified for a > scalar-expression in a SELECT clause can not be used in a WHERE, GROUP BY or > HAVING clause as it is a column in the derived table, not the base table.
That was my interpretation of the standard. Names specified by 'AS' clauses cannot be used elsewhere in the SELECT that defines them. Therefore the earlier behaviour is correct, GROUP BY must be referring to the names of columns in the table. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users