Display binary(16) column as hex in mysql

前端 未结 3 1293
傲寒
傲寒 2021-01-20 00:23

Given a binary(16) column, how do I display its value as a hexadecimal number? I\'ve been experimenting in the console a little below, and I\'m not getting the results I exp

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-20 01:22

    Just try this and you will clear your mind:

    select conv(cast(10 as binary), 10, 16);

    BINARY data type is treated as decimal string by default

提交回复
热议问题