0

When I fetch the records from the LIKE the query returns no results but when I fetch records from the equal to (=) then the query returns results.

Following user name are stored in the database:

(1) `~@#$%'\|/?.><^&%@()-_+-:
(2) (){}[]|\/?"*&^%$#@sujeet`


I am searching the records from the LIKE operator as the following ways:

(1)

SELECT * FROM user WHERE user LIKE '%`~@#$%''\\|/?.><^&%@()-_+-:%'

(2)

SELECT * FROM user WHERE user LIKE '%(){}[]|\\/?"*&^%$#@test`%'

And I am fetching the records from the equal to (=) operator as the following ways:

(1)

SELECT * FROM user WHERE user = '`~@#$%''\\|/?.><^&%@()-_+-:'

(2)

SELECT * FROM user WHERE user = '(){}[]|\\/?"*&^%$#@test`'

But when I am fetching the records from the LIKE operator the the query returns no results and when I am fetching records from the equal to operator then the query returns results. Both of the SQL query is shown above.

Please suggest how I will solve this problem.

Thank You
Sujeet.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by sujeetsin
0

I am using Mysql. Also the username is:

(){}[]|\/?"*&^%$#@test`

not (){}[]|\/?"*&^%$#@sujeet`

Thank You
Sujeet.

Which DB is it (MySQL, MS SQL, Oracle, MS Access)?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.