Re: two foreign keys

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>
Cc: Brian <Brrrian(at)Excite(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: two foreign keys
Date: 2002-02-16 23:26:00
Message-ID: 14233.1013901960@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Josh Berkus" <josh(at)agliodbs(dot)com> writes:
> SELECT session_id, session_name, op_start.operator_name,
> op_end.operator_name
> FROM sessions
> JOIN operators op_start ON sessions.operator_start_id =
> op_start.operator_id
> JOIN operators op_end ON sessions.operator_end_id =
> op_start.operator_id;

I think you meant "ON sessions.operator_end_id = op_end.operator_id"
at the end there. Otherwise a fine example...

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Allan M. Wind 2002-02-17 06:18:00 Object Relational Mapping
Previous Message Josh Berkus 2002-02-16 22:16:19 Re: two foreign keys