ビュー

create view view1 as select * from tab1;

show create view view1;


CREATE VIEW view1 AS SELECT * FROM tab1;


select TABLE_SCHEMA,TABLE_NAME
from information_schema.tables where TABLE_TYPE = 'VIEW' and TABLE_SCHEMA = 'test';

 

\dv+

create view view1 as select * from tab3;

create view view1 as
select tab1.col1 as col11,tab1.col2 as col12,tab2.col1 as col21
from tab1 left join tab2 on tab1.col1 = tab2.col1;
go