时间:2021-07-01 10:21:17 帮助过:4人阅读
oracle 连续号码分段,我们如何分组:
select min(t.fphm),max(t.fphm) ,count(1), (max(t.fphm)-min(t.fphm)+1) from (select fphm, (fphm-rownum) as tnum from bw_fpzxx s where s.XHDWDM=‘91310101132208081P‘ and s.fplxdm=‘026‘ and s.kprq >= TO_DATE ( ‘2019-07-01‘, ‘yyyy-mm-dd hh24:mi:ss‘ ) AND s.kprq <= TO_DATE ( ‘2019-07-31 23:59:59‘, ‘yyyy-mm-dd hh24:mi:ss‘ ) order by fphm ) t group by t.tnum
sql 技巧查询
标签:rac case ase 编号 style ref strong htm href