AS
The keyword that gives a column, expression or table a new name in a query.
In more detail
Name every computed column with AS, or its heading becomes the expression text itself and any program reading it by name breaks when the spacing changes. The same keyword can name a table in FROM, where it is optional.
Example
price_cents * stock AS stock_value_centsRelated terms
- computed column — A column in a query's answer whose value is calculated from other values, such as price times quantity.
- table alias — A short name given to a table inside one query, such as c for customers, used to qualify its columns.
- SELECT — The SQL statement that reads data: it names the columns you want in the answer and, with FROM, the tables they come from.
Taught in
- The SELECT Statement And Projection — PostgreSQL, Indexing & Relational Data Modeling
- Inner Joins And Table Aliases — PostgreSQL, Indexing & Relational Data Modeling