Re: [SQL] Better way to check more than 1 value NOT IN (...)

2011-09-24 Thread pasman pasmaƄski
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

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

2011-09-24 Thread 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 . 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

Re: [SQL] better way

2000-08-28 Thread Renato De Giovanni
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

[SQL] better way

2000-08-28 Thread Sherwin Daganato
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