Skip to content

Instantly share code, notes, and snippets.

@jsntn
Created May 8, 2014 04:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsntn/5db8d237cb57a0098414 to your computer and use it in GitHub Desktop.
Save jsntn/5db8d237cb57a0098414 to your computer and use it in GitHub Desktop.
-- 用来复制字符串,如下'ab'表示要复制的字符串,2表示复制的份数
mysql> select repeat('ab',2);
+----------------+
| repeat('ab',2) |
+----------------+
| abab |
+----------------+
1 row in set (0.00 sec)
-- 又如
mysql> select repeat('a',2);
+---------------+
| repeat('a',2) |
+---------------+
| aa |
+---------------+
1 row in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment