mysql 보기 sql에서oracle 보기 sql로 변환

1014 단어 mysqloracle
mysql에서 내보낸 보기 sql:
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`%` SQL SECURITY DEFINER VIEW `v_privilegelist` AS select `p`.`id` AS `id`,`p`.`name` AS `NAME`,`p`.`info` AS `info`,group_concat(`u`.`id` separator ',') AS `url_id`,group_concat(`u`.`name` separator ',') AS `url_name`,group_concat(`u`.`url` separator ',') AS `url_url` from ((`privilege` `p` left join `privilegeurl` `pu` on((`p`.`id` = `pu`.`privilegeid`))) left join `url` `u` on((`pu`.`urlid` = `u`.`id`))) group by `p`.`id`;

oracle에서 실행 가능한 sql로 변경:
CREATE  VIEW v_privilegelist AS select p.id  id,p.name  NAME,p.info  info,
listagg(u.id , ',')within group( order by u.id)  url_id,
listagg(u.name , ',')within group( order by u.name)  url_name,
listagg(u.url , ',')within group( order by u.url)  url_url from ((privilege p left join privilegeurl pu on((p.id = pu.privilegeid))) left join url u on((pu.urlid = u.id))) group by p.id,p.name,p.info;

좋은 웹페이지 즐겨찾기