ESCAPE with Single Quote ?

Database
Enthusiast

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 ?

4 REPLIES
Enthusiast

Re: ESCAPE with Single Quote ?

Try this

sel * from db.table where field like '''TEST''%' ;

Thanks

Santanu

Enthusiast

Re: ESCAPE with Single Quote ?

no error, but also no rows

Enthusiast

Re: ESCAPE with Single Quote ?

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

Enthusiast

Re: ESCAPE with Single Quote ?

SEL * FROM   ....    WHERE C1 LIKE     '%''FOOD''%'

works now, thanks