This question already has an answer here:
- What's the purpose of SQL keyword “AS”? 6 answers
Say I have a table states
with each state's abbreviation. The following two queries give the same result:
SELECT name
FROM states s
WHERE s.abbrev='CA';
SELECT name
FROM states AS s
WHERE s.abbrev='CA';
Both give California
in the output.
It seems that the query works just fine with or without AS. So my question is, what difference does the keyword AS
make, and what are the cases when we must or must not use AS
?
Aucun commentaire:
Enregistrer un commentaire