Reg: Nested query

Поиск
Список
Период
Сортировка
От Vignesh Raaj
Тема Reg: Nested query
Дата
Msg-id ed6e9ae90812011039u6d1964baqdf01b72d222d8cab@mail.gmail.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: "Stefan Keller"
Дата:
Сообщение: Re: Need some informations...
Следующее
От: Mikko Sundell
Дата:
Сообщение: account domain