rewriting query to move filter conditionout of a subselect

Поиск
Список
Период
Сортировка
От Rhys Stewart
Тема rewriting query to move filter conditionout of a subselect
Дата
Msg-id 189966030610110706w7bf81794mcb1354cd41a3aa68@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi all I have the following query that sources two tables:

select pi2.* from allpoints2 a1
inner join prem_info pi2 on pi2.prem = a1.prem AND the_geom is null
AND pi2.multiplier > 1
where route in
(select route from prem_info pi
inner join allpoints2 a on a.prem = pi.prem
where feederid = '241/6-210'
group by route)

is it possible to rewrite the query so that i can filter for feederid
outside of a subselect, (so that i could call it from a view maybe) or
should i do a set returning function ?

В списке pgsql-general по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: How does PG access wal files?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: query log corrupted-looking entries