Is there an expression I can use to convert integers to a count of characters, for simple graphing?
What I want is this:
+---+-------+
| 5 | ----- |
| 1 | - |
| 2 | -- |
| 4 | ---- |
+---+-------+
答案 0 :(得分:2)
SELECT REPEAT('-',int_column) FROM TABLE
答案 1 :(得分:1)
From the manual
mysql> SELECT REPEAT('MySQL', 3);
'MySQLMySQLMySQL'
https://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_repeat ->