length

Description

Syntax

‘INT length (VARCHAR str)’

Returns the length of the string in byte size.

example

  1. mysql> select length("abc");
  2. +---------------+
  3. | length('abc') |
  4. +---------------+
  5. | 3 |
  6. +---------------+
  7. mysql> select length("中国");
  8. +------------------+
  9. | length('中国') |
  10. +------------------+
  11. | 6 |
  12. +------------------+

keyword

LENGTH