Recursive select
Jason Kwok <jason@newhonest.com>
From: "Jason Kwok" <jason@newhonest.com>
To: <pgsql-sql@postgresql.org>
Date: 2001-10-26T06:57:18Z
Lists: pgsql-sql
I have a table : MyID parentID ================ 5 6 6 7 3 13 7 3 Is there any simple select statement that can get all rows with MyID = 5 and all its parents? That means 5's parenet is 6, 6's parent is 7, 7's parent is 3..... Jason --- Virus Free Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.286 / Virus Database: 152 - Release Date: 2001/10/9