Answer the question
In order to leave comments, you need to log in
How to get next value from database?
How to get the next value?
For example:
the database has numbers 5,6,9,10,1,15
I delete the number 10, how can I get the next number?
Answer the question
In order to leave comments, you need to log in
get the rowid of the desired record
delete the record
select the next record based on the received rowid + 1
specifically in this case the rowid of record 10 was equal to 4 and + 1, the next record with rowid >=5 :
-- выбираем слудющую запись по rowid(10) + 1 -> 4+1
select num
from numbers
where rowid >= 5 -- 4+1
order by rowid
limit 1;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question