tags:

views:

74

answers:

2

I'm trying to run the following query against an Oracle DB, but the query is returning 0 records:

select * from TABLE 
where upper(FIELD) like '%SEE COMMENT%'

I know this field contains many records with 'See Comment" in it. For example, here is one of the records:

=if(and(Robust_Mean>=20,Robust_Mean<=70),.03*(Robust_Mean+29),
if(Robust_Mean>70,.083*(Robust_Mean^.9),"See Comment"))

I am guessing that the quotation marks in the field are messing the query up, but im not sure how to get around it. Any suggestions?

+1  A: 

This works for me:

create table testLike (aCol varchar2(500) );

INSERT INTO TESTLIKE VALUES('abc');
insert into testLike values('=if(and(Robust_Mean>=20,Robust_Mean<=70),.03*(Robust_Mean+29),
if(Robust_Mean>70,.083*(Robust_Mean^.9),"See Comment"))');


SELECT * 
  FROM TESTLIKE TL 
 WHERE upper(tl.acol) like '%SEE COMMENT%';

can you recreate?

edit: in your query try this:

select * from TABLE 
WHERE UPPER(FIELD) = '=if(and(Robust_Mean>=20,Robust_Mean<=70),.03*(Robust_Mean+29),
if(Robust_Mean>70,.083*(Robust_Mean^.9),"See Comment"))';

see if that comes up with any results

tanging
yup, that worked for me too.... now i'm really confused.
Randy
A: 

wow, just realized there were two similarly named fields in this table, I was choosing the wrong one. I'm an idiot... thanks for the help

Randy
You should mark your answer as the Accepted Answer so others who see the question will waste their time going through it trying to find an answer.
Cyberherbalist