SQL Question

Поиск
Список
Период
Сортировка
Искать
От
Kevin Crenshaw
Тема
SQL Question
Дата
Msg-id
20060222144307.85D3A9DC877@postgresql.org
Список
Дерево обсуждения
SQL Question "Kevin Crenshaw" <kcrenshaw@viscient.com>
Re: SQL Question Sean Davis <sdavis2@mail.nih.gov>
Re: SQL Question "Kevin Crenshaw" <kcrenshaw@viscient.com>

I have a table called ‘tasks’ with a structure like this:

 

Taskid            ParentId

----------------------------

1                                                                    null

2                                                                    1

3                                                                    1

4                                                                    Null

5                                                                    4

6                                                                    4

7                                                                    Null

8                                                                    Null

9                                                                    15

10                                                                18

 

 

The taskid column is the primary key and the parentid column references values in the taskid column.  However, it is possible for the parentid to be a value that is not found in the taskid column (hence my question…).  I need to write a query that will retrieve all rows where the parentid is either ‘null’ or does not exist in the taskid column.

 

Any help would really be appreciated.

 

Thanks!

 

Kevin

 

 

В списке pgsql-novice по дате отправления
От: Shuying Wang
Дата:
Сообщение: Re: table inheritance
От: Jaromír Kamler
Дата:
Сообщение: drop index
FAQ