Use bitsCN.com for alias of MySQL notes
You can obtain an alias for the table and field during query. This alias can replace the specified table and field.
Alias for table
Mysql> SELECT * FROM department d
-> WHERE d. d_id = 1001;
+ ------ + ----------- + -------------- + ------------- +
| D_id | d_name | function | address |
+ ------ + ----------- + -------------- + ------------- +
| 1001 | Ministry of Science and Technology | R & D product | layer 5, Building 3 |
+ ------ + ----------- + -------------- + ------------- +
Row in set (0.00 sec)
Here, a specific department table named d is retrieved.
Alias for field
Mysql> SELECT d_id AS department_id, d_name AS department_name
-> FROM department;
+ --------------- + ----------------- +
| Department_id | department_name |
+ --------------- + ----------------- +
| 1001 | Ministry of Science and Technology |
| 1002 | production department |
| 1003 | sales department |
+ --------------- + ----------------- +
Rows in set (0.00 sec)
The syntax here is similar to the above except that the
BitsCN.com