视图创建,使用,删除

视图的创建语法:
语法形式:
create view 视图名 【(字段名1,字段名2,字段名3,…)】 as select语句;
举例:
create view v1 as
select id, f1, name, age, email, p_id, f3 from 表1 where id > 7 and id < 100 or f1 < 1000 and age > 10
在这里插入图片描述
使用视图:
基本上,当做一个表用就了!
比如:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
删除视图:
drop view 【if exists】 视图名;

猜你喜欢

转载自blog.csdn.net/qq_37171379/article/details/86690707