mysql as与Alias别名用法详解
① 表的SQL Alias 语法
代码如下 | 复制代码 |
SELECT column_name(s) FROM table_name AS alias_name |
例子:
代码如下 | 复制代码 |
SELECT po.OrderID, p.LastName, p.FirstNameFROM Persons AS p, Product_Orders AS poWHERE p.LastName='Adams' AND p.FirstName='John' |
② 列的SQL Alias 语法
代码如下 | 复制代码 |
SELECT column_name AS alias_name FROM table_name |
例子:
代码如下 | 复制代码 |
SELECT LastName AS Family, FirstName AS Name FROM Persons |
补充:数据库,mysql教程