-
'LIKE' Statement and '%'
Hello Guys,
i would to know how to make a 'like' statement with a sentence wihch could contains the '%' character.
ie : 100 % in the sentence "100 % free"
for instance the statement should have been :
select * from tablename where lib like '100 %'
-
create table test112 (id int, name char(30))
insert into test112 select 1,'100 % detail'
insert into test112 select 1,'My detail 5 % detail'
insert into test112 select 1,'60 % detail'
insert into test112 select 1,'60 % detail'
insert into test112 select 1,' My detail 17 %'
select * from test112 where name like '%5 [%]%'
Last edited by MAK; 07-10-2003 at 08:06 AM.
-
Or you can use ESCAPE key word to denote an escape character of your choice
select * from test112 where name like '%5 /%%' ESCAPE '/'
-
-
Originally posted by skhanal
Or you can use ESCAPE key word to denote an escape character of your choice
select * from test112 where name like '%5 /%%' ESCAPE '/'
could you please give me a sample of ESCAPE.
-
use the above table and run the below query
select * from test112 where name like '100 /%%' ESCAPE '/'
or
select * from test112 where name like '%5 /%%' ESCAPE '/'
-
Thank you pal
Have a nice end of day
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|