0

I have a simple query that shows all employees from a view.

 SELECT vw_hiearchy.win_id,
    vw_hiearchy.full_name,
    vw_hiearchy.job_title,
    vw_hiearchy.current_sup_name,
    vw_hiearchy.sbu,
    vw_hiearchy.cost_center,
    vw_hiearchy.lob
   FROM app_reports.vw_hiearchy
  WHERE vw_hiearchy.attrition_date IS NULL;

I'd like to know how I can recursively find the current_sup_name's current_sup_name (all the way up) and possibly comma-delimiting it under a single column?

Odinovsky
  • 551
  • 1
  • 6
  • 23
  • 1
    Possibly useful question: [PostgreSQL pass data from recursive CTE onto function](http://stackoverflow.com/q/10392567/4519059) ;). – shA.t Mar 02 '16 at 08:05
  • The recursive CTE examples [in the docs](http://www.postgresql.org/docs/current/static/queries-with.html) might be a little easier to follow – Nick Barnes Mar 02 '16 at 09:01

0 Answers0