Search Postgresql Archives

rewriting query to move filter conditionout of a subselect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ?


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux