Tag: cte

  • How to write recursive queries in SQL?

    Let’s say you want to find out all the subordinates to a manager recursively. That is say Kiran reports to Guru and Gayathri reports to Kiran , then the subordinates of Guru are both Kiran and Gayathri. This can be done using recursive queries. Let’s see how to do it in PostgreSQL. This is supported…