Sql algorithm all table data one table

0
155

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_content` AS select `act`.`id` AS `id`,`act`.`type` AS `type`,`act`.`url` AS `url`,`act`.`section` AS `section`,`act`.`title` AS `title`,`act`.`content` AS `content`,`chapter`.`chapter_name` AS `chapter_name` from (`act` left join `chapter` on((`act`.`chapter_id` = `chapter`.`id`))) union all select `rules`.`id` AS `id`,`rules`.`type` AS `type`,`rules`.`url` AS `url`,`master_rule`.`name` AS `name`,`rules`.`title` AS `title`,`rules`.`content` AS `content`,`chapter`.`chapter_name` AS `chapter_name` from ((`rules` left join `chapter` on((`rules`.`chapter_id` = `chapter`.`id`))) join `master_rule` on((`master_rule`.`id` = `rules`.`rule`))) union all select `circulars`.`id` AS `id`,`circulars`.`type` AS `type`,`circulars`.`url` AS `url`,`circulars`.`description` AS `description`,`circulars`.`title` AS `title`,`circulars`.`content` AS `content`,'0' AS `chapter_name` from `circulars` union all select `notification`.`id` AS `id`,`notification`.`type` AS `type`,`notification`.`url` AS `url`,`notification`.`description` AS `description`,`notification`.`title` AS `title`,`notification`.`content` AS `content`,'0' AS `chapter_name` from `notification` union all select `others`.`id` AS `id`,`others`.`type` AS `type`,`others`.`url` AS `url`,`others`.`description` AS `description`,`others`.`title` AS `title`,`others`.`content` AS `content`,'0' AS `chapter_name` from `others`;