标签:数据 视图 对比 alt creat esc sele lan 复杂
视图是动态生成的虚拟表,并未保存真实的表,是动态的,只保存了sql逻辑
create view v_user
as
select username, password
from user;
-- 如果没有创建,如果有修改
create or replace view v_user
as
select username, name
from user;
-- 第二种方式
alter view v_user
as
select username, password
from user;
drop view v_user, v_user2;
desc v_user;
show create view v_user;
和从表中查数据一样
select * from v_user
where username=‘lisi‘;
标签:数据 视图 对比 alt creat esc sele lan 复杂
原文地址:https://www.cnblogs.com/qixioa/p/13676566.html