11 lines
378 B
MySQL
11 lines
378 B
MySQL
|
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||
|
SQL SECURITY DEFINER
|
||
|
VIEW `vn2008`.`v_jerarquia`
|
||
|
AS SELECT `vn2008`.`jerarquia`.`worker_id` AS `Id_Trabajador`,
|
||
|
`vn2008`.`jerarquia`.`boss_id` AS `boss_id`
|
||
|
FROM `vn2008`.`jerarquia`
|
||
|
UNION ALL
|
||
|
SELECT DISTINCT `vn2008`.`jerarquia`.`boss_id` AS `Id_Trabajador`,
|
||
|
`vn2008`.`jerarquia`.`boss_id` AS `boss_id`
|
||
|
FROM `vn2008`.`jerarquia`
|