Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Problem with 'like' compare

Problem with 'like' compare

From: ohaya <ohaya_at_cox.net>
Date: Sat, 24 Jul 2004 13:42:50 -0400
Message-ID: <41029F9A.D5ECB864@cox.net>


Hi,

I have a table with a VARCHAR2 field (Oracle 9i), and I'm trying to do a SELECT using a "where ... like ...", and am having a problem.

The field (myfield) in the records in the table contain a bunch of text, and in the middle, there's something like:

"....SerialNumber: [0a]..."

"....SerialNumber: [0b]..."

etc.

My SELECT looks something like:

SELECT * from mytablename where lower(myfield) like lower('%serialnumber: [ 0a]%')

is returning no rows.

If I change the SELECT to:

SELECT * from mytablename where lower(myfield) like lower('%serialnumber:%')

the query does return rows (too many of them!!).

Can someone tell me what is wrong with this?

Thanks,
Jim Received on Sat Jul 24 2004 - 12:42:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US