numbers

NAME

numbers: Listing of numbers in the range 0..4095

TYPE

Table

DESCRIPTION

numbers provides with a reliable source of indexed numbers. Values range [0..4095]. This table is utilized by a few of common_schema's views.

STRUCTURE

mysql> DESC common_schema.numbers;
+-------+----------------------+------+-----+---------+-------+
| Field | Type                 | Null | Key | Default | Extra |
+-------+----------------------+------+-----+---------+-------+
| n     | smallint(5) unsigned | NO   | PRI | NULL    |       |
+-------+----------------------+------+-----+---------+-------+

SYNOPSIS

Columns of this table:

  • n: an unsigned integer. Numbers are sequential, ascending

EXAMPLES

Get 10 lowest values:

mysql> SELECT * FROM common_schema.numbers WHERE n < 10;
+---+
| n |
+---+
| 0 |
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
+---+

ENVIRONMENT

MySQL 5.1 or newer.

SEE ALSO

AUTHOR

Shlomi Noach
 
common_schema documentation