# BIN(N)返回二进制值N的一个字符串表示

mysql> select bin(123);
+----------+
| bin(123) |
+----------+
| 1111011 |
+----------+
1 row in set (0.00 sec)



# OCT(N)返回八进制值N的一个字符串表示

mysql> select oct(123);
+----------+
| oct(123) |
+----------+
| 173 |
+----------+
1 row in set (0.00 sec)



# HEX(N)返回十六进制值N的一个字符串表示

mysql> select hex(123);
+----------+
| hex(123) |
+----------+
| 7B |
+----------+
1 row in set (0.00 sec)



mysql> select concat('0x', hex(123));
+------------------------+
| concat('0x', hex(123)) |
+------------------------+
| 0x7B |
+------------------------+
1 row in set (0.00 sec)

mysql>