Searching and Sorting Strings in Oracle November 20, 2008 When
it comes to searching, how often do you find yourself using the
LIKE (including NOT LIKE) operator in SQL statements? Other
well-known tests include equality and comparison (greater or
less than), and this includes not only strings, but also
numbers. Conceptually, the equality/comparison tests are pretty
simple, and indexes can add a tremendous boost to performance
when these tests are used. However, what takes place when were
not looking for an exact match, but something, well, LIKE the
value of interest? Mathematically, or at least algorithm-wise,
constructing a test for equality is pretty simple. How do you
suppose Oracle approaches the problem of determining if the
string ABCD appears in the string ABCABDABCDAB and if it does,
how many times (as in the use of INSTR)? Further, once we have a
result set, what determines the sorted order? The focus of Part
1 is on searching strings. In Part 2, Ill discuss sorting
strings. One thing that stands ou