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;
Conteúdo para você se capacitar em programação
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;