创建视图的语法:
-
create [or replace] [algorithm = {undefined | merge | temptable}]
-
view view_name [{column_list}]
-
As select_statement
-
[WITH [CASCADED | LOCAL] CHECK OPTION]
修改视图的语法:
-
alter [algorithm = {undefined | merge| temptable}]
-
view view_name [(column_list)]
-
As select_statement
-
[WITH [CASCADED |LOCAL] CHECK OPTION]
删除视图
-
drop view [if exists] view_name,[, view_name] ... [RESTRICT | CASCADE]
显示视图的信息
-
show tables status [from db_name][like 'pattern']
eg: show table status like 'country_view' \G;
查询某个视图的定义
-
show create view view_name \G;
通过查看系统表 information_schema.views 查看视图的信息:
-
select *from information_schema.views where table_name = 'view_name' \G
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26435490/viewspace-1261890/
,如需转载,请注明出处,否则将追究法律责任。