Reg: Nested query - Mailing list pgadmin-support

From Vignesh Raaj
Subject Reg: Nested query
Date
Msg-id ed6e9ae90812011039u6d1964baqdf01b72d222d8cab@mail.gmail.com
Whole thread Raw
List pgadmin-support
Can anyone please help in getting a solution...
I have two table, 1 contains all details of a person with person id as primary key.
the other table has person id and parent id both referring to person table person id.
My query is i have to get all the parents of a given person name.
Please help me in finding a query solution...

                                     Table "person"
   Column   |         Type          |                     Modifiers                     
------------+-----------------------+----------------------------------------------------
 pid        | bigint                | not null default nextval('"person_pid_seq"'::text)
 first_name | character varying(50) |
 surname    | character varying(50) |
 dob        | date                  |
Primary key: person_pkey

        Table "parent_of"
  Column   |  Type   | Modifiers
-----------+---------+-----------
 person_id | integer |
 parent_id | integer |

so if i give first_name of person = ????, then i have get all the parent ids. I tried nested query but tat resulted in 1 level parent alone.
i want to get all parent id... please help me..!

Reagrds,
Vignesh
--
"A man who believes in himself and not circumstances is the real winner"

pgadmin-support by date:

Previous
From: "Stefan Keller"
Date:
Subject: Re: Need some informations...
Next
From: Mikko Sundell
Date:
Subject: account domain