Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group