1WITH RECURSIVE sequence AS (
2 SELECT 1 AS level
3 UNION ALL
4 SELECT level + 1 AS value
5 FROM sequence
6 WHERE sequence.level < 10
7)
8SELECT level
9FROM sequence;
1SELECT @curRow := @curRow + 1 AS row_number
2FROM sometable
3JOIN (SELECT @curRow := 0) r
4WHERE @curRow<100;