use mytest; --找出tb表中列col的缺号 select col+1 as start, (select min(col) from tb where col>t.col)-1 as end from tb as t where not exists (select * from tb where col=t.col+1); order by col;
sql
最新推荐文章于 2024-02-29 21:33:30 发布
use mytest; --找出tb表中列col的缺号 select col+1 as start, (select min(col) from tb where col>t.col)-1 as end from tb as t where not exists (select * from tb where col=t.col+1); order by col;