Doubt on query
От | x asasaxax |
---|---|
Тема | Doubt on query |
Дата | |
Msg-id | 91495cb0809251459pb476740m3160e7395b2044f8@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Doubt on query
|
Список | pgsql-general |
Hi everyone,
I have this table:
create table cat(
cod integer,
cod_super integer,
constraint cod_super_fk Foreign Key(cod_super) references cat(cod),
constraint cod_pk Primary Key(cod)
);
insert into cat values(0, 1);
insert into cat values(1, 0);
insert into cat values(2, 0);
insert into cat values(3, 2);
insert into cat values(4, 3);
insert into cat values(5, 4);
insert into cat values(6, 0);
insert into cat values(7, 0);
The Query i want to do is:
- I want to know all the children´s and subchildrens.
Example 2: I want to know the children´s of 1 will return nothing
Example 3: I want to know the children´s of 2 will return 3, 4, 5
Did anyone knows how can i do this query?
Thanks a lot
:)
В списке pgsql-general по дате отправления: