On Sun, 20 May 2001, Don Baccus wrote:
> At 10:55 AM 5/20/01 -0700, Stephan Szabo wrote:
> > Can the IN always get written as a
> >join and is it always better to do so?
>
> Nope:
> ...
> A better question, I guess, is if it is always better to write
> it as a join if the left hand operand is a table column and
> the right hand operand a rowset.
Well I was assuming we were talking about the subquery case
in general :)
It might be a problem with subqueries with set value functions
and parameters passed down from the outer tables:
select * from blah where
blah.val1 in
(select count(*) from blah2 where blah2.val2=blah.val2
group by blah2.val3);
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html