Re: [GENERAL] Help with strange join

2005-02-07 Thread Mike Rylander
On Mon, 7 Feb 2005 12:34:39 +0100, Victor SpÃng Arthursson <[EMAIL PROTECTED]> wrote: > > 2005-02-04 kl. 20.36 skrev Mike Rylander: > > > How about: > > > > SELECT r.* FROM opskrifter r JOIN opskrifter_content c ON (r.nummer = > > c.opskrift) JOIN opskrifter_ingredienser i ON (c.ingrediens = i.id

Re: [GENERAL] Help with strange join

2005-02-07 Thread Victor Spång Arthursson
2005-02-04 kl. 20.36 skrev Mike Rylander: How about: SELECT r.* FROM opskrifter r JOIN opskrifter_content c ON (r.nummer = c.opskrift) JOIN opskrifter_ingredienser i ON (c.ingrediens = i.id) WHERE EXISTS ( SELECT l.relid FROM languages l WHERE l.relid = i.betegnelse GROUP BY l.relid HAVING COUNT(D

Re: [GENERAL] Help with strange join

2005-02-04 Thread Mike Rylander
On Fri, 4 Feb 2005 17:52:45 +0100, Victor SpÃng Arthursson <[EMAIL PROTECTED]> wrote: > > 2005-02-04 kl. 13.00 skrev Mike Rylander: > > > Can you send the table structure and the query that does this? It may > > just be a matter of adding a subselect with a HAVING clause, but we > > won't know u

Re: [GENERAL] Help with strange join

2005-02-04 Thread Victor Spång Arthursson
2005-02-04 kl. 13.00 skrev Mike Rylander: Can you send the table structure and the query that does this? It may just be a matter of adding a subselect with a HAVING clause, but we won't know until we have more information. Sure - coming up! First table is the main receipt table: tostipippitest=# s

Re: [GENERAL] Help with strange join

2005-02-04 Thread Alban Hertroys
Victor Spång Arthursson wrote: The tables are link according to the following: receipts <- related_ingredients <- ingredients <- languages 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

Re: [GENERAL] Help with strange join

2005-02-04 Thread Mike Rylander
On Fri, 4 Feb 2005 09:44:15 +0100, Victor SpÃng Arthursson <[EMAIL PROTECTED]> wrote: > 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

[GENERAL] Help with strange join

2005-02-04 Thread Victor Spång Arthursson
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