A way to refer to the "outer" query implicitly?

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: A way to refer to the "outer" query implicitly?
Date: 2004-03-19 23:52:10
Message-ID: 87ad2cxumt.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


My code constructs some queries by passing in constraint clauses like
type = 'A'

However one of the constraint clauses is
exists (select 1 from othertable where x = outertable.x)

This works fine, but requires that the caller know that the table being
queried will be "outertable". Is there any way in a subquery used like this to
implicitly reference fields from the outer query?

--
greg

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-03-19 23:55:55 Re: pg_dump on older version of postgres eating huge
Previous Message Steve Krall 2004-03-19 22:23:43 Re: pg_dump on older version of postgres eating huge