repeat

description

Syntax

VARCHAR repeat(VARCHAR str, INT count)

将字符串 str 重复 count 次输出,count 小于1时返回空串,str,count 任一为NULL时,返回 NULL

example

  1. mysql> SELECT repeat("a", 3);
  2. +----------------+
  3. | repeat('a', 3) |
  4. +----------------+
  5. | aaa |
  6. +----------------+
  7. mysql> SELECT repeat("a", -1);
  8. +-----------------+
  9. | repeat('a', -1) |
  10. +-----------------+
  11. | |
  12. +-----------------+

keywords

  1. REPEAT