Try whole tables . This is taken from Xaprb :
create table integers(i int unsigned not null); insert into integers(i) values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9); select (hundreds.i * 100) + (tens.i * 10) + units.i as iii from integers as units cross join integers as tens cross join integers as hundreds;
If you made the last select view with the name, say, xrange999 , then you can simply:
SELECT iii FROM xrange999 WHERE iii BETWEEN 0 AND 9
(Of course, you can only do this with a ten-row integers table, but I find a thousand integers more useful.)
pilcrow
source share