Mysql
 sql >> Database >  >> RDS >> Mysql

Auto join e selezione ricorsiva in una tabella

SELECT id
      FROM emp
START WITH id = 7
CONNECT BY NOCYCLE mgrid = PRIOR id

SQLFIDDLE LINK