On Thu, Apr 20, 2017 at 3:17 PM, jonathan vanasco <postgres(at)2xlp(dot)com> wrote:
>
> SELECT foo_id
> FROM example_a__data
> WHERE foo_id IN (SELECT bar_id FROM example_a__rollup)
> ;
>
>
>
Or write it the idiomatic way (i.e., as a proper semi-join):
SELECT foo_id
FROM example_a__data
WHERE EXISTS (SELECT 1
FROM example_a__rollup
WHERE example_a__rollup.bar_id =
example_a__data.foo_id)
IME its harder to forget the table prefix when using this form.
David J.