1.创建视图:
create view 视图表名 as select 列名一,列名二 from 表名;
改列名且联合多个表建立视图:
create view 视图表名 as select 表一.列名 as 新列名,表二.列是 as 新列名 from 表一,表二 where 表一.列名=表二.列名;
2.修改视图的列名:
alter view 视图表名 as select 表一.列名 as 新列名,表二.列是 as 新列名 from 表一,表二 where 表一.列名=表二.列名;
3.查看视图的具体信息:
show create view view_name
4.删除视图:
drop view tablename;
或者:
drop view if exists tablename;