Insert hex values into MySql

后端 未结 4 1645
一个人的身影
一个人的身影 2020-12-05 10:20

I have a table with a VARBINARY column. I need to insert a string such as \'4D2AFF\' which represents the hex values 0x4D, 0x2A and 0xFF respectively. How do I construct t

4条回答
  •  感动是毒
    2020-12-05 10:54

    Or you can do even this:

    INSERT INTO tbl (col) VALUES (X'4D2AFF')
    

    See this for some more info.

提交回复
热议问题