Creating Table Aliases with AS
You can create table aliases by using AS just as you can create column aliases; see “Creating Column Aliases with AS” in Chapter 4. Table aliases:
Save typing
Reduce statement clutter
Exist only for the duration of a statement
Don’t appear in the result (unlike column aliases)
Don’t change the name of a table in the database
Also are called correlation names in the context of subqueries (see Chapter 8)
To create a table alias:
- In a FROM clause or JOIN clause, type:
table is a table name, and alias is its alias name. alias is a single, unquoted word that contains only letters, digits, or underscores; don’t use spaces, punctuation, or special characters. The AS keyword is optional (Listing 7.2 and ...
table [AS] alias
Get SQL: Visual QuickStart Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.