|
SQL BASIC
|
|
|
|
DATA QUERY LANGUAGE
|
|
|
|
BASIC FUNCTION
|
|
|
|
AGGREGATE FUNCTION
|
|
|
|
DATA MANIPULATION LANGUAGE
|
|
|
|
DATA DEFINITION LANGUAGE
|
|
|
|
DATA CONTROL LANGUAGE
|
|
|
|
OTHERS
|
|
|
|
|
|
|
|
ALIAS
|
SELECT <column-list> FROM <table> AS
<new name>
|
The table name or column name returned by SELECT command can be renamed to other
name with the AS operator.
Table: Orders
| OrderID |
Customer |
Employee |
Order Date |
ShippedVia |
Freight |
ShipCountry |
| 10248 |
Wilman Kala |
Buchanan, Steven |
04-07-1996 |
Federal Shipping |
$32.38 |
France |
| 10249 |
Hanari Carnes |
Peacock, Margaret |
08-07-1996 |
United Package |
$65.83 |
Brazil |
| 10250 |
Hanari Carnes |
Leverling, Janet |
08-Jul-1996 |
United Package |
$58.17 |
Brazil |
| 10251 |
Chop-suey Chinese |
Buchanan, Steven |
11-Jul-1996 |
United Package |
$22.98 |
Switzerland |
| 10252 |
Richter Supermarkt |
Dodsworth, Anne |
12-Jul-1996 |
Federal Express |
$148.33 |
Switzerland |
SELECT Customer, Employee,
Freight, ShipCountry AS Country FROM
Orders
The above SQL statement renames the column name ShipCountry to
Country as shown in Resultset1 below.
Resultset1
| Customer |
Employee |
Freight |
Country |
| Wilman Kala |
Buchanan, Steven |
32.38 |
France |
| Hanari Carnes |
Peacock, Margaret |
65.83 |
Brazil |
| Hanari Carnes |
Leverling, Janet |
58.17 |
Brazil |
| Chop-suey Chinese |
Buchanan, Steven |
22.98 |
Switzerland |
| Richter Supermarkt |
Dodsworth, Anne |
148.33 |
Switzerland |
.
|
|