Reputation: 1545
I have a MySQL table with a text column. Some rows have null characters (0x00) as part of this text column (along with other characters).
I am looking for a query that will return all rows containing any null characters for this column, but I cannot figure out how the proper syntax for my "where column like '%...%'" clause.
Thank you!
Upvotes: 14
Views: 6036
Reputation: 1545
Right after I submitted the question, a suggested link to this related question provided my answer: Query MySQL with unicode char code
WHERE CAST(column AS BINARY) LIKE CONCAT("%", 0x00, "%")
Upvotes: 16