举个栗子:
create view myview1 as select e.last_name,d.department_name from employees as e left join departments as d on e.department_id=d.department_id where d.department_id=6;方式一:
create or replace view 视图名 as 查询语句;方式二:
alter view 视图名 as 查询语句;前提:必须要有删除视图的权限
drop view 视图名,视图名...;视图的可更新性和视图中查询的定义有关系,以下类型的 视图是不能更新的。
包含以下关键字的sql语句:分组函数、distinct、group by 、having、union或者union all常量视图Select中包含子查询joinfrom一个不能更新的视图where子句的子查询引用了from子句中的表