numbers
description
表函数,生成一张只含有一列的临时表,列名为number
,如果指定了const_value
,则所有元素值均为const_value
,否则为[0,number
)递增。
syntax
numbers(
"number" = "n"
<, "const_value" = "x">
);
参数:
number
: 行数。const_value
: 常量值。
example
mysql> select * from numbers("number" = "5");
+--------+
| number |
+--------+
| 0 |
| 1 |
| 2 |
| 3 |
| 4 |
+--------+
5 rows in set (0.11 sec)
mysql> select * from numbers("number" = "5", "const_value" = "-123");
+--------+
| number |
+--------+
| -123 |
| -123 |
| -123 |
| -123 |
| -123 |
+--------+
5 rows in set (0.12 sec)
keywords
numbers, const_value