Número seq gerar em SQL

select
newcode
+step
from
(select max(code) as newcode from cpncode) c,
(select count(*) as step
from cpncode a, cpncode b
where
a
.code <= b.code
group by a.code limit 5) d;