Re: IN vs EXIIST - Mailing list pgsql-general

From Darren Ferguson
Subject Re: IN vs EXIIST
Date
Msg-id Pine.LNX.4.44.0209191352010.8082-100000@thread.crystalballinc.com
Whole thread Raw
In response to Re: IN vs EXIIST  (Jean-Luc Lachance <jllachan@nsd.ca>)
List pgsql-general
I realized after he sent his notice this morning.

On Thu, 19 Sep 2002, Jean-Luc Lachance wrote:

> This is not what he wants.
>
> He wants all keys that have only true for x.
>
>
> > Why areyou using the sub select. If you just want all the key1 where x is
> > true then the following will work
> >
> > SELECT DISTINCT(key1) FROM a WHERE x = TRUE;
> >
> > If you want all rows and don't care about duplicates then remove the
> > distinct.
> >
> > Hope this helps
> >
> > >
> > > I've seen many posts saying that using IN is not optimal and replacing
> > > it with EXISTS is much better. I've read the only docs but I can't
> > > understand the difference between the two or how to convert.
> > >
> > > Can someone point me to some other docs or explain to me how to convert?
> > > Or is my table schema wrong?
> > >
> > > Thanks!
> > >
> > > Jc
> > >
>

--
Darren Ferguson


pgsql-general by date:

Previous
From: Dmitry Tkach
Date:
Subject: Re: Memory Errors...
Next
From: Stephan Szabo
Date:
Subject: Re: cascade problems