Re: Help formulating multi-table SELECT statement

From: "Travis Hoyt" <thoyt(at)npc(dot)net>
To: "Phil Mitchell" <phil(dot)mitchell(at)pobox(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Help formulating multi-table SELECT statement
Date: 2002-02-26 20:58:19
Message-ID: DBEMKMGOMJAGKAKEPPEGAEAMDBAA.thoyt@npc.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

What values in your tables are unique? Are there many keyID's for the
same key or the reverse? And the same question for the keys_sigs table.
Can you give an example of your data? I would guess that the two inner
selects should not return multiple rows. Maybe I'm not getting the
picture.

-----Original Message-----
From: pgsql-novice-owner(at)postgresql(dot)org
[mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of Phil Mitchell
Sent: Tuesday, February 26, 2002 3:39 PM
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] Help formulating multi-table SELECT statement

At 02:53 PM 2/26/02, you wrote:
>Hey Phil,
>
>Not sure if this will work..don't have any tables like that to test this
>on but try this:
>
>SELECT sig FROM sigs WHERE sigID=(SELECT sigID FROM keys_sigs WHERE
>keyID=(SELECT keyID FROM keys WHERE key = X));

Travis, I had tried nesting the selects like that, but postgres apparently
complains when subselects return multiple values.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Patrick Hatcher 2002-02-26 22:46:18 COPY from on date field problem
Previous Message Phil Mitchell 2002-02-26 20:39:28 Re: Help formulating multi-table SELECT statement