1. Column Aliases
1. To add an alias to a column, you can use a AS
keyword followed by an alias, for example:SELECT
[column_1 | expression] AS descriptive_name
FROM
table_name
;
2. If the alias contains spaces, the following must be quoted:SELECT
[column_1 | expression] AS `descriptive name`
FROM table_name;//别名加上双引号。
3. CONCAT_WS
The function is used to connect the first name and last name, and can be used with AS, for example:SELECT
CONCAT_WS(', ', lastName, firstname) AS `Full name`FROM
employees;
2. Table alias
1. You can use aliases to add different names to tables. Use AS
keywords to assign aliases to table names, as in the following query syntax:table_name AS table_alias