Re: Oracle 9i LIKE search assistance

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Thu, 20 Nov 2008 22:10:29 +0100
Message-ID: <4925d24d$0$190$e4fe514c@news.xs4all.nl>


trpost_at_gmail.com schreef:
> I am looking to be able to search a VARCHAR column in a table for a
> search string; Here is an example:
>
> Table: cases
>
> description
> -----------------
> airport bla bla bla
> bla bla bla airport
> bla airport bla bla
>
>
> SELECT description FROM cases WHERE description LIKE '%airport%'
>
> The problem is this only returns 1 result:
> bla airport bla bla
>
> To get all 3 results I would need to use the following queries or do
> an inline OR:
> SELECT description FROM cases WHERE description LIKE '%airport%'
> SELECT description FROM cases WHERE description LIKE 'airport%'
> SELECT description FROM cases WHERE description LIKE '%airport'
>
> I am unfortunalely restricted to Oracle 9i with this database; I see
> with Oracle 10 I can use regular expressions, but that doesn't look
> like an option for me here.
>
> Does anyone have a more efficient way to be able to search a string in
> Oracle 9i and get all 3 results regardless of where the search word
> appears in the string.

Are you sure you did not put a space between ' and % ? So : like ' %airport%' ????

Shakespeare Received on Thu Nov 20 2008 - 15:10:29 CST

Original text of this message