posted 22 years ago
Hi,
I'm executing a query which is like:
SELECT USERNAME,USERNO........FROM USER WHERE USERNAME LIKE ?;
I'm using PreparedSatements for this, and passing the value entered by the user. If user wants to search for a name beginning with Ma_, I'm passing 'Ma_%' to the SELECT statement. But I get all rows beginning with Ma, including ones like Ma9189,Ma7594, then I get Ma_744, till Ma_zzz, and Maaaa till Mazzz. I expected to see only usernames beginning with Ma_. Why are all numbers beginning with Ma also shown, and also all user names beginning with Ma not having the underscore ?
Any clarifications will be very helpful.
Thanks.