Ask a Question related to PostgreSQL / PGSQL, Design and Development.
-
Mike Rylander #1
Re: Help with strange join
On Fri, 4 Feb 2005 09:44:15 +0100, Victor SpƄng Arthursson
<victor@tosti.dk> wrote:Can you send the table structure and the query that does this? It may> 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".
just be a matter of adding a subselect with a HAVING clause, but we
won't know until we have more information.
--
Mike Rylander
[email]mrylander@gmail.com[/email]
GPLS -- PINES Development
Database Developer
[url]http://open-ils.org[/url]
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [email]majordomo@postgresql.org[/email])
Mike Rylander Guest
-
Is left-join faster then inner join?
Some people said that using left-join is generally faster than inner join, is that true? Thanks... -
FMS Join two flv...
Hello! I have an application where i need join two flv, this possible? Tks, Luiz -
Which JOIN ?
I have 2 tables: "first" and "second" table "first" has 2 columns (id, a) and 2 records: id --- a 1 --- apples 2 --- pears table "second"... -
JOIN vs no JOIN
Is there any benefit in doing: SELECT a.f1, a.f2, b.f3 FROM t1 a INNER JOIN t2 b ON a.f1=b.id WHERE a.f1> 0 rather than SELECT a.f1, a.f2,... -
Is self-join appropriate?
Please forgive me if this post is too long. I was trying to solve this (probably simple) issue for all day but I'm not as good in SQL as I thought...



Reply With Quote

