当前位置:Gxlcms > 数据库问题 > mysql查找某连续字段中断的编号

mysql查找某连续字段中断的编号

时间:2021-07-01 10:21:17 帮助过:18人阅读

    查询dj_pxlb表中zwh 空缺的值

         select model2.zwh-1 as kqzwh from (select model1.zwh from dj_pxlb as model1 where model1.ccbh =‘abc‘ order by model1.zwh desc) as model2 where model2.zwh>1 and not exists (select model3.zwh from dj_pxlb as model3 where  model3.ccbh =‘abc‘ and model3.zwh=model2.zwh-1);

 

mysql查找某连续字段中断的编号

标签:sql   order by   des   desc   exists   esc   model   sele   where   

人气教程排行