Just to add to this, rather use a temp table with an auto-incrementing id field. Then you can use a while loop if you know the size of the table (select count(1) as numRecords from tbl_x).
(Pseudo code)
WHILE (i <= numRecords)
i++;
END
Just to add to this, rather use a temp table with an auto-incrementing id field. Then you can use a while loop if you know the size of the table (select count(1) as numRecords from tbl_x).
(Pseudo code)
WHILE (i <= numRecords)
i++;
END