All Forums Database
abort_session 6 posts Joined 07/14
28 Jul 2014
ESCAPE with Single Quote ?

I want to seach this string exactly:     ('TEST')
 
sel * from database.test where feld  like    '@'TEST@''  ESCAPE'@'.
 
Is this not possible with Single Quotes ?

Santanu84 122 posts Joined 04/13
28 Jul 2014

Try this
sel * from db.table where field like '''TEST''%' ;
Thanks
Santanu

abort_session 6 posts Joined 07/14
28 Jul 2014

no error, but also no rows

Santanu84 122 posts Joined 04/13
28 Jul 2014

Are you trying this? Please share your table and data.

 

CREATE MULTISET TABLE db.TABLES

(

C1 VARCHAR(10)

)

NO PRIMARY INDEX

;

 

INSERT INTO db.TABLES VALUES ('''FOOD''');

 

SEL * FROM db.TABLES ;

 

SEL * FROM db.TABLES WHERE C1 LIKE '''FOOD''%' ;

 

Thanks

Santanu

abort_session 6 posts Joined 07/14
28 Jul 2014

SEL * FROM   ....    WHERE C1 LIKE     '%''FOOD''%'
 
works now, thanks

You must sign in to leave a comment.