Re: maximum number of expressions in a list is 1000
From: Norman Dunbar <oracle_at_dunbar-it.co.uk>
Date: Thu, 03 Jan 2013 08:03:11 +0000
Message-ID: <50E53B3F.20008_at_dunbar-it.co.uk>
On 03/01/13 07:21, jo wrote:
> Sayan Malakshinov wrote:
>> It can be solved through: (field, -1) in((1,-1),(2,-1),(3,-1)...(n,-1))
Date: Thu, 03 Jan 2013 08:03:11 +0000
Message-ID: <50E53B3F.20008_at_dunbar-it.co.uk>
On 03/01/13 07:21, jo wrote:
> Sayan Malakshinov wrote:
>> It can be solved through: (field, -1) in((1,-1),(2,-1),(3,-1)...(n,-1))
> This solution is great, Sayan.
> I didn't know this syntax.
> For curiosity, what does it mean the -1 in the second position?
> I suppose it can be every value, -1 or everything else.
You can do this with IN, it's not just a single column type expression:
SELECT ... WHERE (id, id2) in ((1, 1), (1, 2), (2, 2), (3, 3), (4, 7), ...);
So the above with the -1 is just saying:
SELECT ... WHERE (id, id2) in ((1, -1), (3, -1), (2, -1), (3, -1), (4, -1), ...);
However, I have to say that I wasn't aware that this could get past the 1000 literal expressions in an in-list restriction.
Cheers,
Norm.
-- Norman Dunbar Dunbar IT Consultants Ltd Registered address: Thorpe House 61 Richardshaw Lane Pudsey West Yorkshire United Kingdom LS28 7EL Company Number: 05132767 -- http://www.freelists.org/webpage/oracle-lReceived on Thu Jan 03 2013 - 09:03:11 CET