postgresql syntax while exists loop
- by veilig
I'm working at function from Joe Celkos book - Trees and Hierarchies in SQL for Smarties
I'm trying to delete a subtree from an adjacency list but part my function is not working yet.
WHILE EXISTS –– mark leaf nodes
(SELECT *
FROM OrgChart
WHERE boss_emp_nbr = -99999
AND emp_nbr > -99999)
LOOP –– get list of next level…