Reputation: 12033
I would like to locate all strings in a table containing the 0x02 character.
For clarity, I am looking for something like:
SELECT * FROM table WHERE column LIKE '%0x02%'
Upvotes: 3
Views: 1527
Reputation: 5003
I would go with
SELECT * FROM table WHERE LOCATE(X'02', column) > 0
Upvotes: 3
Reputation: 5894
Hex literals? A %
is 0x25
SELECT * FROM table WHERE column LIKE 0x250225
Checking the manual reminds me that the 0x
syntax isn't strictly SQL standard, so maybe use X''
instead
SELECT * FROM table WHERE column LIKE X'250225'
Upvotes: 2