Both queries will give the same result, would "AS" make some difference? if yes, what it is? if no, then what is point using it?
SQL aliases are used to give a table, or a column in a table, a temporary name. Aliases are often used to make column names more readable. An alias only exists for the duration of that query. An alias is created with the AS keyword.
The AS command is used to rename a column or table with an alias. An alias only exists for the duration of the query.
According to ANSI/ISO SQL the AS keyword is optional. But some dbms products want it, while others don't want it... There's also the alias=columnValue syntax; i.e. select x=1, 2 as y, 3 z used in some DBMS systems.
The AS keyword in SQL is used to create a temporary alias for a table or column. This alias can be used instead of the name in the SELECT statement.
I think the reason is simple. Consider code such as the following:
select a, b, c, d
. . .
It is very easy to occasionally skip the comma:
select a b, c, d
If you don't use as
then this looks like correct code and it can be difficult to figure out. If you always use as
for column aliases, then you know it is incorrect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With