The three ways I know of to alias:
- TableColumn AS MyAlias
- TableColumn MyAlias
- MyAlias = TableColumn
Re: 1), I prefer this as it is the most self-documenting code (IMO), and it lets me search for AS
if I need to find aliases..
Re: 2), This is my second choice, but without the AS
, I am never sure whether this is a cut-and-paste error or not, especially in long, badly-formatted queries.
Re: 3), I don't like this because a) it looks like an assignment, and b) it blends in too much with ON
clauses and CASE
statements
So, my vote is to use the AS
keyword for your aliases.