Quantcast

How to use Like Operator with (%) in MyBatis?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

How to use Like Operator with (%) in MyBatis?

v.sk
This post has NOT been accepted by the mailing list yet.
I want to achieve Select * from patient where last_name like '%john%' with mybatis 3.0.

I am using the following code but somehow doesn't seam to work as expected and gets all the records.
select * from patient where last_name like '%'|| #{lastName} ||'%'.

Anyone aware of the solution?

Regards,
Sk
Loading...