Re: where clauses and multiple tables

Поиск
Список
Период
Сортировка
От miller_2555
Тема Re: where clauses and multiple tables
Дата
Msg-id 25355681.post@talk.nabble.com
обсуждение исходный текст
Ответ на where clauses and multiple tables  (Scott Frankel <frankel@circlesfx.com>)
Список 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 по дате отправления:

Предыдущее
От: Scott Frankel
Дата:
Сообщение: where clauses and multiple tables
Следующее
От: David W Noon
Дата:
Сообщение: Re: where clauses and multiple tables