Skip to content
Advertisement

T-SQL – Aliasing using “=” versus “as” [closed]

Is there any particular reason (performance or otherwise) to use AS ahead of = when aliasing a column?

My current approach (for readability) is to use this:

select
alias1     = somecolumn
alias2     = anothercolumn
from
tables
etc...

instead of this:

select
somecolumn as alias1
anothercolumn as alias2
from
tables
etc...

Is there a performance or maintainability reason to use one over the other?

Advertisement

Answer

‘=’ isn’t valid ANSI SQL, so you’ll have difficulty should you wish to run your application on a different DBMS.

(It’s when ANSI form is used but the optional ‘AS’ is omitted I find the results difficult to read, personally.)

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement