sql中as的小用法

一般来说,sql中as都是后面跟一个别名。例如
  select name as 姓名 from user;

 

用其他表做基表创建视图或新表,常用于备份数据。 例如
  create table user_1 as (select * from user);


在备份表的时候,可以新增列并赋默认值使用。例如
  create table user_2 as (select '1' as valid_ind, u.* from user u);

posted on 2019-09-18 10:35  lemon_fjl  阅读(950)  评论(0编辑  收藏  举报