@Daniel-Loyer,
The AS
is used to rename a column or table with an alias. The alias is only good for that query.
For example, you "might" have a table called "Customers", a descriptive good name. I might choose to alias that with AS to c
and "Orders" to o
.
SELECT o.OrderID, o.OrderDate, c.CustomerName
FROM Customers AS c, Orders AS o
WHERE c.CustomerName="Around the Horn" AND c.CustomerID=o.CustomerID;
It's in the SELECT
and in the WHERE
statements that we see the use of the AS effectively. We no longer have to type the whole unambiguous name of tablename.fieldname
There is another command for ascending order
which is ASC
.
Hope that helps!
Cordially,
Ronnie Wong
Edutainer Manager, ITProTV
*if the post above has answered the question, please mark as solved.
**All "answers" and responses are offered "as is" and my opinion. There is no implied service, support, or guarantee by ITProTV.