Mysql 获取自增主键删除的主键

SELECT message_id+1 
from message_transmit_record a
where not EXISTS (
    select * from message_transmit_record b where  b.message_id=a.message_id+1 
)
AND a.message_id< (SELECT max(message_id) from message_transmit_record)
ORDER BY a.message_id asc limit 2
posted @ 2022-09-13 19:29  雾里看花的少年  阅读(47)  评论(0编辑  收藏  举报