Re: where clauses and multiple tables - Mailing list pgsql-general

From miller_2555
Subject Re: where clauses and multiple tables
Date
Msg-id 25355681.post@talk.nabble.com
Whole thread Raw
In response to where clauses and multiple tables  (Scott Frankel <frankel@circlesfx.com>)
List pgsql-general

Scott Frankel-3 wrote:
>
> Is it possible to join tables in the where clause of a statement
>
> I've explored the "where exists" clause, but that's not supported by
> the application toolkit I'm using. AFAIK, I've only got access to
> where ...
>
> Thanks in advance!
> Scott
>

Not entirely sure of the objective, but perhaps an inner join is the topic
for which you are looking? Else, I'd suggest one of the following formats
(which may, or may not, be available to you).

SELECT foo.* FROM (SELECT * FROM bar WHERE bar."bar_id"='value') AS foo
WHERE ....
SELECT foo.*  FROM foo WHERE foo."bar_id" IN (SELECT bar."bar_id" FROM bar
WHERE ...);
SELECT foo.*  FROM foo WHERE foo."bar_id" IN (SELECT bar."bar_id"
FROM(SELECT ....) AS bar WHERE ...);

--
View this message in context: http://www.nabble.com/where-clauses-and-multiple-tables-tp25355350p25355681.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Scott Frankel
Date:
Subject: where clauses and multiple tables
Next
From: David W Noon
Date:
Subject: Re: where clauses and multiple tables