Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to get query to use an index
2006/4/13, Michael Garfield Sørensen, CeDeT <mgs_at_cedet.dk>:
>> SQL> REM equivalent to the OR-version if
> SQL> REM To the best of my knowledge, the
> SQL> REM modified UNION-ALL-version is
Third statement below probably is useful even if c1 and/or c2 is null.
Additionally to test nulls I'll insert another two rows:
insert into mgsx values ('x', null);
insert into mgsx values (null, 'x');
-- original statement ith OR
SQL> select * from mgsx where c1 like 'x%' or c2 like 'x%';
C1 C2
---------- ----------
x y x x y x x x x x
6 rows selected.
C1 C2
---------- ----------
x y x x x x x y x
5 rows selected.
C1 C2
---------- ----------
x y
x
x x y x x x x
6 rows selected.
Gints
-- http://www.freelists.org/webpage/oracle-lReceived on Fri Apr 14 2006 - 10:53:45 CDT
![]() |
![]() |