bin

description

Syntax

STRING bin(BIGINT x) 将十进制数x转换为二进制数.

example

  1. mysql> select bin(0);
  2. +--------+
  3. | bin(0) |
  4. +--------+
  5. | 0 |
  6. +--------+
  7. mysql> select bin(10);
  8. +---------+
  9. | bin(10) |
  10. +---------+
  11. | 1010 |
  12. +---------+
  13. mysql> select bin(-3);
  14. +------------------------------------------------------------------+
  15. | bin(-3) |
  16. +------------------------------------------------------------------+
  17. | 1111111111111111111111111111111111111111111111111111111111111101 |
  18. +------------------------------------------------------------------+

keywords

  1. BIN