簡化版的創建視圖
create view 視圖名
as
select col ...coln
from 表create view 視圖名(依次別名)
as
select col ...coln
from 表create view 視圖名
as
select col “別名1”,。。。col "別名n"
from 表
show tables ; 查看表 同時也包含視圖
查看視圖的屬性信息
show table status like ’視圖‘ --支持% _ 注意table 沒用 s , 查看表和視圖 show tables; 有s
查看視圖的詳細定義信息
show create view 視圖 \G;
修改視圖
create or replace view 視圖名
as
select * from 表名alert view 視圖名
as
select * from 表名
刪除視圖
drop view 視圖名1[, 視圖2,。。。視圖n ]
drop view if exists 視圖名1[, 視圖2,。。。視圖n ]