Re: Functions returning sets

From: Don Baccus <dhogaza(at)pacifier(dot)com>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Functions returning sets
Date: 2001-05-20 18:29:00
Message-ID: 3.0.1.32.20010520112900.01728e10@mail.pacifier.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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:

openacs4=# select 1 in (1,2,3);
?column?
----------
t
(1 row)

You might also do something like

"select count(*) from foo where foo.state in ('rejected', 'banned');"

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.

- Don Baccus, Portland OR <dhogaza(at)pacifier(dot)com>
Nature photos, on-line guides, Pacific Northwest
Rare Bird Alert Service and other goodies at
http://donb.photo.net.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2001-05-20 18:55:02 Re: Functions returning sets
Previous Message Don Baccus 2001-05-20 18:21:44 Re: Re: External search engine, advice