Better way to check more than 1 value NOT IN (...)

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Better way to check more than 1 value NOT IN (...)
Date: 2011-09-24 09:38:48
Message-ID: 4E7DA528.9010902@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
I've got to check if 2 values are not in a set that is dynamically
calculated by a function.

The query looks like

select some_id, ....
from .....
where 10 is not in ( select x from my_function (some_id))
and 20 is not in ( select x from my_function (some_id))

Is there a efficiency issue with calculating the set twice ?
Can I somehow check both (or more) values at once?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message pasman pasmański 2011-09-24 11:54:41 Re: Better way to check more than 1 value NOT IN (...)
Previous Message Andreas 2011-09-24 00:06:16 Howto build a funtion that selects an id or inserts a value