Re: problem with table structure

Поиск
Список
Период
Сортировка
От Tim Landscheidt
Тема Re: problem with table structure
Дата
Msg-id m3630pdmue.fsf@passepartout.tim-landscheidt.de
обсуждение исходный текст
Ответ на problem with table structure  (Miguel Vaz <pagongski@gmail.com>)
Ответы Re: problem with table structure  (Miguel Vaz <pagongski@gmail.com>)
Список pgsql-general
Miguel Vaz <pagongski@gmail.com> wrote:

> [...]
> * sites (generic):

> id_site
> name
> description
> x
> y

> * site_natural
> id
> id_site
> altitude

> * site_arqueology
> id
> id_site
> id_category
> id_period

> But i seem to be missing something. How can i have this in a way that its
> easy to list only "arqueology sites" for example. I feel the solution is
> simple enough, even for me, but its eluding me. Any help in the right
> direction would be very appreciated.

You mean archaeological sites that are not also natural
sites?

| SELECT * FROM site_arqeuology
|   WHERE id_site NOT IN
|     (SELECT id_site FROM site_natural);

There are numerous other ways to do this, i. e., with "LEFT
JOIN", "EXCEPT", etc.

Tim

В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: How to download Non-Installer (ZIP) Postgres 8.3 for Windows?
Следующее
От: Jayadevan M
Дата:
Сообщение: Queries about PostgreSQL PITR