12

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!

CJS
  • 1,455
  • 1
  • 13
  • 17

2 Answers2

13

Right after I submitted the question, a suggested link to this related question provided my answer: Query MySQL with unicode char code

WHERE column LIKE CONCAT("%", CHAR(0x00 using utf8), "%");

Community
  • 1
  • 1
CJS
  • 1,455
  • 1
  • 13
  • 17
2

The following worked for me...

WHERE column LIKE "%\0%";
Drew
  • 1,420
  • 1
  • 11
  • 14