Pete <p...@mollysrevenge.com> wrote:
> Thanks.  I guess I'd like to confirm just where column aliases can
> be referenced.  I think they cannot be referenced within the list of column
> names in which they are defined, and they can be referenced in any other
> clauses of the SELECT statement, eg WHERE, ORDER BY, GROUP BY, HAVING. Is
> that correct?

Per SQL standard, column aliases can be referenced in ORDER BY, GROUP BY and 
HAVING clauses. As an extension, SQLite also allows them in WHERE and JOIN ON 
clauses, but again, such usage is non-standard (though very convenient at 
times). Neither the standard nor SQLite implementation allow referencing 
aliases in the SELECT clause.
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to