Help with strange join

Поиск
Список
Период
Сортировка
От Victor Spång Arthursson
Тема Help with strange join
Дата
Msg-id d34f8ec91e8a318f32afb2529016660f@tosti.dk
обсуждение исходный текст
Ответы Re: Help with strange join  (Mike Rylander <mrylander@gmail.com>)
Re: Help with strange join  (Alban Hertroys <alban@magproductions.nl>)
Список pgsql-general
God morning, everybody!

I have a problem that I don't seem to be able to solve by my self,
thats why I kindly ask the list now…

I have a database containing some tables, containing different receipts.

Every receipt have an unknown number of ingredients linked to it, and
every ingredients name is in a separate table sincce it needs to be
translated to different languages.

The tables are link according to the following:

receipts <- related_ingredients <- ingredients <- languages

On a listpage I want to list (ten and ten) all receipts that has _all
the ingredients translated_.

My problem is how to find out that every ingredient is translated.

If I just do JOINs, I will not be able to find out if only one or all
of the ingredients are translated. What I need is something that, for
example, returns the receiptnumber if, and only if, the number of
translated ingredients that is returned (after joining ingredients with
languages) is the same as the number of entrys in the table
"related_ingredients".

Since I'm really close to deadline on this project and standing still
for the moment, I really would appreciate some help right now...

Best regards,

Victor Spång Arthursson

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

Предыдущее
От: "Julian Scarfe"
Дата:
Сообщение: Re: pgpool 2.5b2 released
Следующее
От: Joseph Kiniry
Дата:
Сообщение: Re: Backing up and restoring a database with the SELinux pg_user problem.