|
insert into rk_process (code,name,label) values ('01','lee001','aa' )
insert into rk_process (code,name,label) values ('01','lee002','aa' )
insert into rk_process (code,name,label) values ('01','lee003','aa' )
insert into rk_process (code,name,label) values ('01','leek001','aa' )
insert into rk_process (code,name,label) values ('01','leek001','aa' )
want to filter only (lee) but it showing (leek) also
select name from rk_process where name like '%lee%')
thanks in advance.
Result
lee001
lee002
lee003
leek001
leek001
but i need only
lee001
lee002
lee003
|
|
|
|
|
You specified in your like clause that you want any words with "lee" so that is what you get. Try "lee0" so it will not get those containing the 'k'.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Not tested, but off-hand...
'%lee[0-9]%'
or
'%lee[^k]%'
P.S. You didn't specify which database system you are using. And you probably don't need the leading percent sign (% )
modified 28-Dec-12 12:55pm.
|
|
|
|
|
Tested:
select name from rk_process where name like '%lee[0-9]%'
Yields:
lee001
lee002
lee003
|
|
|
|
|
thank you so much PIEBALDconsult
|
|
|
|
|
by using this query you can achive you require output
select * from rk_process where name like '%lee0%'
--raj
|
|
|
|