You can write condition in subquery:
where 0=(select count(*) from myfunction(id) where x in (10,20))
2011/9/24, Andreas :
> 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 .
> whe
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
Didn't test this, but I think it should also work:
SELECT a.oid_fld
FROM for_payment a, for_payment b
WHERE b.serial_fld = 2
AND b.char_fld = a.char_fld
AND a.serial_fld <> 2
--
Renato
Sao Paulo - SP - Brasil
[EMAIL PROTECTED]
> Is there a better way to write this:
>
> SELECT a.oid_fld FROM for
Is there a better way to write this:
SELECT a.oid_fld FROM for_payment a
WHERE a.serial_fld <> 2
AND EXISTS
(SELECT b.char_fld FROM for_payment b
WHERE b.serial_fld = 2
AND b.char_fld = a.char_fld)
Table for_payment
+-++---+
| serial_fld | char_fld | oid_fld