#1137

The name path from the top to an employee

For each employee in emp, build the chain of names from the topmost manager down to them, joined by > (e.g. CEO > VP-Eng > EngMgr). Return id and path, ordered by id.

Esempio di output atteso

Ecco come appare una risposta corretta — il suo numero di righe è a sé stante, non deve corrispondere alle tabelle dello schema.

idpath
1CEO
2CEO > VP-Eng
3CEO > VP-Sales

Il risultato della tua query apparirà qui