as关键字
1、为表取别名
SELECT * FROM 表名 [AS] 表的别名 WHERE .... ;
select * from student as stu;
2、为字段取别名
SELECT 字段名1 [AS] 别名1 , 字段名2 [AS] 别名2 , ... FROM 表名 WHERE ... ;
select name as '姓名',id from student;
as关键字
1、为表取别名
SELECT * FROM 表名 [AS] 表的别名 WHERE .... ;
select * from student as stu;
2、为字段取别名
SELECT 字段名1 [AS] 别名1 , 字段名2 [AS] 别名2 , ... FROM 表名 WHERE ... ;
select name as '姓名',id from student;