Re: Two joins on same foreign key - Mailing list pgsql-general

From Anony Mous
Subject Re: Two joins on same foreign key
Date
Msg-id 005201c3e82f$08f5f6b0$7402a8c0@PETER
Whole thread Raw
In response to Re: Two joins on same foreign key  (elein <elein@varlena.com>)
List pgsql-general
I must say, I'm really appreciative with the responses from this list.
Thanks to all!




-----Original Message-----
From: elein [mailto:elein@varlena.com]
Sent: January 31, 2004 12:10 PM
To: Anony Mous
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Two joins on same foreign key

PostgreSQL General Bits Issue #56 has an article on Join Basics
which also has an example of multiple table joins.

http://cookie.varlena.com/varlena/GeneralBits/56.php

--elein
elein@varlena.com

On Fri, Jan 30, 2004 at 03:03:35PM -0700, Anony Mous wrote:
> Hi,
>
>
>
> I??m fairly new to this database, and have read much discussion on
> sub-queries.  I??ve seen that they can be great for some queries, and
downright
> slow for others.  I have a table with two foreign keys referencing another
> table, like:
>
>
>
> Table #1
>
> employee_id (pk)
>
> employee_name
>
>
>
> Table #2
>
> teamleader_employee_id
>
> backup_employee_id
>
>
>
> both fields in table 2 need to do a lookup in table 1 to get the name of
the
> actual employee.  Do I need to use nested queries to accomplish this?  Any
help
> is greatly appreciated!
>
>
>
> -AM
>


pgsql-general by date:

Previous
From: elein
Date:
Subject: Re: Two joins on same foreign key
Next
From: Louis LeBlanc
Date:
Subject: Re: Large object insert/update and oid use