numbers

description

Table function that generates a temporary table containing only one column with the column name number and all element values are const_value if const_value is specified, otherwise they are [0,number) incremented.

syntax

  1. numbers(
  2. "number" = "n"
  3. <, "const_value" = "x">
  4. );

parameter:

  • number: Line number.
  • const_value: the constant value.

example

  1. mysql> select * from numbers("number" = "5");
  2. +--------+
  3. | number |
  4. +--------+
  5. | 0 |
  6. | 1 |
  7. | 2 |
  8. | 3 |
  9. | 4 |
  10. +--------+
  11. 5 rows in set (0.11 sec)
  12. mysql> select * from numbers("number" = "5", "const_value" = "-123");
  13. +--------+
  14. | number |
  15. +--------+
  16. | -123 |
  17. | -123 |
  18. | -123 |
  19. | -123 |
  20. | -123 |
  21. +--------+
  22. 5 rows in set (0.12 sec)

keywords

  1. numbers, const_value