Alias (SQL)
It is proposed that this article be deleted because of the following concern:
If you can address this concern by improving, copyediting, sourcing, renaming, or merging the page, please edit this page and do so. You may remove this message if you improve the article or otherwise object to deletion for any reason. Although not required, you are encouraged to explain why you object to the deletion, either in your edit summary or on the talk page. If this template is removed, do not replace it. This message has remained in place for seven days, so the article may be deleted without further notice. Find sources: "Alias" SQL – news · newspapers · books · scholar · JSTOR Nominator: Please consider notifying the author/project: {{subst:proposed deletion notify|Alias (SQL)|concern=Code instructions breach [[:WP:NOTGUIDE]] #1}} ~~~~ Timestamp: 20111004191654 19:16, 4 October 2011 (UTC) Administrators: delete |
You can give an another name to a table by using an alias.
This can be a good thing to do if you have very long or complex table names.
Note: An alias name could be anything, but usually it is short.
Syntax: SELECT * FROM table_name AS alias_name
For Example:
DepartmentID | DepartmentName |
---|---|
31 | Sales |
33 | Engineering |
34 | Clerical |
35 | Marketing |
SELECT D.DepartmentName
FROM Department AS D
Note: We can also write like this
SELECT D.DepartmentName
FROM Department D