I have a table T:
create table T(C1 VARCHAR(64));
and some records in it:
010/a
010/b
011/c
012/d
and create index on c1.
I want records which begin with '010'.
Now, two query:
(1) select * from t where c1 like '010%';
(2) select * from t where c1>='010' and c1 < '011';
have the same result:
010/a
010/b
My question is:
(1) How does DB2 compare two strings? The comparison is related to codepage?
(2) Is query (2) a optimized way of query (1)? If not, can someone give a record which appears in the result of query (2) but not begins with '010'?
(3) How does query (2) utilize index?
I am from China. Thank you for your reply.