Developing By Me

Project Development and Design

Alias

  The alias option is used to redefine something with a more meaningful name. The alias is used for returned fields and tables to provide either a more meaningful return value or to shorten a long name. In order to alias something the AS keyword is used but it is optional or implied. The following table shows how these two clause options can be defined:

 

SQL Query Description
SELECT field1 AS f1 Changes the name of field1 to f1 which can be referenced later in the query
SELECT field1 f1
JOIN table1 AS t1 Changes the name of table1 to t1. This definition means that any reference to table1 must use t1 instead since table1 is no longer available.
JOIN table1 t1

 

%d bloggers like this: