티스토리 뷰

반응형

MySql ViewTable 생성 및 작성방법

CREATE OR REPLACE
ALGORITHM = UNDEFINED VIEW `뷰테이블명` AS
select
    `cl1`.`name` AS `cate1_name`,
    `cl1`.`type` AS `cate1_type`,
    `cl2.`name` AS `cate2_name`,
    `cl2.`type` AS `cate2_type`,
    `cl3.`name` AS `cate3_name`,
    `cl3.`type` AS `cate3_type`,
from
    ((`table3` `cl3`
left join `table2` `cl2` on
    ((`cl3`.`level2` = `cl2`.`idx`)))
left join `table1` `cl1` on
    ((`cl3`.`level1` = `cl1`.`idx`)));

 

끗#$%@#%@#$!

반응형