In this case, the answer is in SQL92, with row value constructors.
Select .. where (id ,num, code) > >= = < <= ...
Optimizer can just pick up the index, no table scans, easy semantic
mapping.
Would you not ask your management to ask the vendor to implement
standards that can help, this being here part of ... SQL92?
For those who want more complex things, index definition based on an
expression, working behind the scenes.
Bernard Dhooghe
> In this case, the answer is in SQL92, with row value constructors.
>
> Select .. where (id ,num, code) > >= = < <= ...
You can do a "(id, num, code) = (val1, val2, val3)" in DB2. The other
comparison operators are not handled that way, though. Semantically, this
is identical to "(id = val1 AND num = val2 AND code = val3)". So the
combined variation is just syntactic sugar.
> Optimizer can just pick up the index, no table scans, easy semantic
> mapping.
The DB2 optimizer will do just that if it estimates that this would lead to
better execution times.
> Would you not ask your management to ask the vendor to implement
> standards that can help, this being here part of ... SQL92?
Sure, I would. However, I wouldn't ask for minor syntactical things but
rather for real important features like the MERGE statement or range
partitioning.
p.s: I still don't understand why you're referring to a deprecated standard.
SQL92 is superseeded by SQL:1999, which in turn is out-of-date since
December 2003 wher SQL:2003 was published by ISO.

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
Bernard Dhooghe - 25 Apr 2006 23:02 GMT
I refer to SQL92 as in this standard, the row-value constructor clause
was introduced to solve the problem of this posting (and a number of
others in this newsgroup).
So it is part of a standard that is 13-14 years old. Let us respect
what was crafted by the committee then.
Is is not minor, there is no fully semantical equivalent way to express
what is contained in the clause. When (c1,c2) >= (v1,v2) is needed,
written as c1 > v1 or c1 = v1 and c2 >= v2 can the optimizer detect
what is meant exactly? This is certainly much more difficult than
implementing row value constructors.
Bernard Dhooghe
> > In this case, the answer is in SQL92, with row value constructors.
> >
[quoted text clipped - 26 lines]
> DB2 Information Integration Development
> IBM Germany2
--CELKO-- - 26 Apr 2006 13:52 GMT
>> I still don't understand why you're referring to a deprecated standard.
SQL92 is superseeded by SQL:1999, which in turn is out-of-date since
December 2003 wher SQL:2003 was published by ISO. <<
But then you get into the problems of porting code to products that are
just getting to SQL-92 and the way the US Government (largest user of
computers on Earth) only wants SQL-92 code. Then local syntax for this
feature varies between SQL:2003 and SQL Server, etc.
I'd go with the VIEW fopr practical reasons right now and then switch
over when more products have it.