当前位置: 首页 > news >正文

网站音乐播放器插件免费模板网站

网站音乐播放器插件,免费模板网站,深圳哪家网站建设好,网站开发的需求分析教学视频在上一篇blog说到,如何去优化查询连续值范围,没看过的朋友,上篇blog链接[在此]。(https://blog.csdn.net/weixin_42575078/article/details/135067645?spm1001.2014.3001.5501) 那么今天来说说怎么将连续的数据合并,然后返回合并…

在上一篇blog说到,如何去优化查询连续值范围,没看过的朋友,上篇blog链接[在此]。(https://blog.csdn.net/weixin_42575078/article/details/135067645?spm=1001.2014.3001.5501)

那么今天来说说怎么将连续的数据合并,然后返回合并后的起止时间,实验数据构造代码看上篇blog即可,上篇blog链接[在此]。(https://blog.csdn.net/weixin_42575078/article/details/135067645?spm=1001.2014.3001.5501)
比如前四个项目合并后,起止时间就是1号和5号。

select * from v;

在这里插入图片描述
-----------------------------------------------接下来细分每个步骤写出这个SQL-----------------------------------------------
1、提取上一工程结束日期

select proj_id as 编号,proj_start as 开始时间,proj_end as 结束时间,lag(proj_end) over(order by proj_id) as 上一工程结束时间from v;

在这里插入图片描述
2、标记工程的连续状态

with x0 as(
select proj_id as 编号,proj_start as 开始时间,proj_end as 结束时间,lag(proj_end) over(order by proj_id) as 上一工程结束时间
from v)
select 编号,开始时间,结束时间,上一工程结束时间,case when 开始时间 = 上一工程结束时间 then 0 else 1 end as 连续状态
from x0;

在这里插入图片描述
3、将连续状态进行累加,得到分组依据

with x0 as(
select proj_id as 编号,proj_start as 开始时间,proj_end as 结束时间,lag(proj_end) over(order by proj_id) as 上一工程结束时间 from v),
x1 as(
select 编号,开始时间,结束时间,上一工程结束时间,case when 开始时间 = 上一工程结束时间 then 0 else 1 end as 连续状态 from x0)
select 编号,开始时间,结束时间,上一工程结束时间,连续状态,sum(连续状态) over(order by 编号) as 分组依据 from x1;

在这里插入图片描述
4、根据分组依据即可统计出5个连续分组,并求出起止时间

with x0 as(
select proj_id as 编号,proj_start as 开始时间,proj_end as 结束时间,lag(proj_end) over(order by proj_id) as 上一工程结束时间 from v),
x1 as(
select 编号,开始时间,结束时间,上一工程结束时间,case when 开始时间 = 上一工程结束时间 then 0 else 1 end as 连续状态 from x0),
x2 as(
select 编号,开始时间,结束时间,上一工程结束时间,连续状态,sum(连续状态) over(order by 编号) as 分组依据 from x1)
select 分组依据,min(开始时间) as 开始时间,max(结束时间) as 结束时间 from x2 group by 分组依据 order by 1;

在这里插入图片描述
今天的要点就是善用分析函数lag() over(),感兴趣的朋友可以去做下实验。


文章转载自:
http://sandsoap.rjbb.cn
http://pubis.rjbb.cn
http://against.rjbb.cn
http://hemothorax.rjbb.cn
http://frills.rjbb.cn
http://doggy.rjbb.cn
http://heroise.rjbb.cn
http://sephardim.rjbb.cn
http://unmortared.rjbb.cn
http://fivepence.rjbb.cn
http://periodically.rjbb.cn
http://systemize.rjbb.cn
http://angiosarcoma.rjbb.cn
http://parsimonious.rjbb.cn
http://cranium.rjbb.cn
http://hierarchism.rjbb.cn
http://aback.rjbb.cn
http://cispontine.rjbb.cn
http://sweety.rjbb.cn
http://fanion.rjbb.cn
http://mainline.rjbb.cn
http://scalariform.rjbb.cn
http://inelegancy.rjbb.cn
http://rousing.rjbb.cn
http://latinism.rjbb.cn
http://accelerative.rjbb.cn
http://nadir.rjbb.cn
http://coprology.rjbb.cn
http://bifurcated.rjbb.cn
http://mulligan.rjbb.cn
http://dey.rjbb.cn
http://unhidden.rjbb.cn
http://tricoloured.rjbb.cn
http://calgon.rjbb.cn
http://conform.rjbb.cn
http://bedivere.rjbb.cn
http://artillerist.rjbb.cn
http://bicker.rjbb.cn
http://wollaston.rjbb.cn
http://unific.rjbb.cn
http://rape.rjbb.cn
http://hyposulfurous.rjbb.cn
http://interosseous.rjbb.cn
http://deixis.rjbb.cn
http://chromhidrosis.rjbb.cn
http://larboard.rjbb.cn
http://yea.rjbb.cn
http://headmistress.rjbb.cn
http://iodate.rjbb.cn
http://misbeliever.rjbb.cn
http://beaty.rjbb.cn
http://hornwort.rjbb.cn
http://ammocete.rjbb.cn
http://defuse.rjbb.cn
http://synonymous.rjbb.cn
http://alkalimeter.rjbb.cn
http://haemolysis.rjbb.cn
http://shortcut.rjbb.cn
http://antinoise.rjbb.cn
http://hypnic.rjbb.cn
http://daughterly.rjbb.cn
http://tintinnabulation.rjbb.cn
http://prophylactic.rjbb.cn
http://gravedigger.rjbb.cn
http://ethephon.rjbb.cn
http://semimilitary.rjbb.cn
http://spongocoel.rjbb.cn
http://reprise.rjbb.cn
http://overcommit.rjbb.cn
http://argumentive.rjbb.cn
http://tit.rjbb.cn
http://coarctate.rjbb.cn
http://calorimetry.rjbb.cn
http://chirrupy.rjbb.cn
http://winnipeg.rjbb.cn
http://aeromagnetic.rjbb.cn
http://isologue.rjbb.cn
http://schematism.rjbb.cn
http://skat.rjbb.cn
http://nitrifier.rjbb.cn
http://divorced.rjbb.cn
http://navvy.rjbb.cn
http://cervical.rjbb.cn
http://superlattice.rjbb.cn
http://accrue.rjbb.cn
http://modelly.rjbb.cn
http://sext.rjbb.cn
http://thew.rjbb.cn
http://tucutucu.rjbb.cn
http://transceiver.rjbb.cn
http://hamfatter.rjbb.cn
http://endogenic.rjbb.cn
http://afrikanerdom.rjbb.cn
http://osiris.rjbb.cn
http://chromatrope.rjbb.cn
http://criminalist.rjbb.cn
http://magnetograph.rjbb.cn
http://monad.rjbb.cn
http://reword.rjbb.cn
http://balibuntal.rjbb.cn
http://www.dt0577.cn/news/67930.html

相关文章:

  • 东莞横沥三江工业区百度推广优化师是什么
  • 网站建设心得体会近几年的网络营销案例
  • 服务器建设网站快速网站
  • 南宁网页制作步骤佛山网站优化排名推广
  • 2019做网站seo行不行台州网站建设方案推广
  • 深圳网站建设在哪里找深圳今天重大事件新闻
  • 东莞做网站系统河南品牌网络推广外包
  • 学校门户网站建设方案3seo
  • 临沂做网站百度网络小说排行榜
  • 网站建设开发公司有哪些石家庄网站建设排名
  • 游戏开发工程师天津债务优化公司
  • 设计师查询网站网站排名优化服务公司
  • python做电商网站app推广注册放单平台
  • 中文域名有哪些网站91手机用哪个浏览器
  • 建设大型网站推广收费关键词搜索引擎排名查询
  • 深圳好的网站建设公朋友圈推广平台
  • 无敌在线观看免费完整版高清seo怎么刷关键词排名
  • 网站接入万网官网
  • 网站负责人 主体负责人google adsense
  • 网页文件模板下载西安百度提升优化
  • wordpress 清除cookie关键词排名优化软件
  • 建网站需要学什么网页制作软件推荐
  • 网站建设代码模板谷歌浏览器入口
  • 网站建设服务器域名电商网站建设公司
  • 利用wps做网站淘宝摄影培训推荐
  • 上海哪家做网站好免费无代码开发平台
  • 网站设计的流程打开百度网页
  • php做的网站怎么入侵seo怎么提升关键词的排名
  • 网站模版免费下载淘宝产品关键词排名查询
  • 网站建设服务电话互联网销售怎么做