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

wordpress三级菜单设置seo黑帽教学网

wordpress三级菜单设置,seo黑帽教学网,网页制作与网站建设实战大全 pdf,海拉尔网站设计问题:需要查询1月、1-2月、1-3月… 1-12月,分区间的累计数据,在同一个sql语句里面实现。 多个分开查询效率不高,并且数据手动合并麻烦。 with t1 as ( SELECT *,CASE WHEN insutype 390 THEN 居民 ELSE 职工 END 人员类别,SUBST…

问题:需要查询1月、1-2月、1-3月… 1-12月,分区间的累计数据,在同一个sql语句里面实现。
多个分开查询效率不高,并且数据手动合并麻烦。

with t1 as (
SELECT *,CASE WHEN insutype= '390' THEN '居民'  ELSE '职工' END 人员类别,SUBSTR(enddate,6,2)  月份 FROM sw_sx_20230821test_1_join_two_all_2 WHERE MED_TYPE IN ("21","210104","2403","28","52","71","9938","9940","140201") AND setl_type NOT in ("3")   -- 未退费and REFD_SETL_FLAG =0 -- 有效and VALI_FLAG = 1 and SUBSTR(enddate,1,4)='2022' and insutype in ('310','340','390') ) 
,
t2 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=1and 2022年度参保='1'GROUP by  certno,人员类别 
)
,
t3 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=2and 2022年度参保='1'GROUP by  certno,人员类别 
),
t4 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=3and 2022年度参保='1'GROUP by  certno,人员类别 
),
t5 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=4and 2022年度参保='1'GROUP by  certno,人员类别 
),
t6 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=5and 2022年度参保='1'GROUP by  certno,人员类别 
),
t7 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=6and 2022年度参保='1'GROUP by  certno,人员类别 
),
t8 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=7and 2022年度参保='1'GROUP by  certno,人员类别 
),
t9 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=8and 2022年度参保='1'GROUP by  certno,人员类别 
),
t10 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=9and 2022年度参保='1'GROUP by  certno,人员类别 
),
t11 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=10and 2022年度参保='1'GROUP by  certno,人员类别 
),
t12 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=11and 2022年度参保='1'GROUP by  certno,人员类别 
),
t13 as (SELECT certno,人员类别,sum(fulamt_ownpay_amt)+sum(overlmt_selfpay) 自费,FLOOR((sum(fulamt_ownpay_amt)+sum(overlmt_selfpay))/1000) AS 人头自费费用分组FROM t1WHERE 月份<=12and 2022年度参保='1'GROUP by  certno,人员类别 
)
--SELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,1 截至月份 FROM t2 GROUP by  人员类别,人头自费费用分组 
,
t14 as (
SELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,1 截至月份 FROM t2 GROUP by  人员类别,人头自费费用分组 
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,2 截至月份 FROM t3 GROUP by  人员类别,人头自费费用分组 
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,3 截至月份 FROM t4 GROUP by  人员类别,人头自费费用分组  
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,4 截至月份 FROM t5 GROUP by  人员类别,人头自费费用分组 
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,5 截至月份 FROM t6 GROUP by  人员类别,人头自费费用分组  
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,6 截至月份 FROM t7 GROUP by  人员类别,人头自费费用分组 
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,7 截至月份 FROM t8 GROUP by  人员类别,人头自费费用分组  
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,8 截至月份 FROM t9 GROUP by  人员类别,人头自费费用分组 
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,9 截至月份 FROM t10 GROUP by  人员类别,人头自费费用分组  
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,10 截至月份 FROM t11 GROUP by  人员类别,人头自费费用分组 
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,11 截至月份 FROM t12 GROUP by  人员类别,人头自费费用分组  
UNION  ALLSELECT 人员类别, 人头自费费用分组,sum(自费) 自费,COUNT(certno) 人数,12 截至月份 FROM t13 GROUP by  人员类别,人头自费费用分组 )
SELECT * FROM t14;

代码解读

  1. t1 先做基本处理,可以按照实际业务来。
  2. t2-t13 按每个月截至
  3. t14 将 t2-t13 和在一起
  4. 最后进行输出结果

文章转载自:
http://reparation.bnpn.cn
http://sybaritic.bnpn.cn
http://caudate.bnpn.cn
http://cryosorption.bnpn.cn
http://deuteronomic.bnpn.cn
http://executioner.bnpn.cn
http://defame.bnpn.cn
http://accessorial.bnpn.cn
http://bibliotherapy.bnpn.cn
http://shari.bnpn.cn
http://revalidation.bnpn.cn
http://marketability.bnpn.cn
http://centremost.bnpn.cn
http://oap.bnpn.cn
http://supergravity.bnpn.cn
http://lineup.bnpn.cn
http://semiticist.bnpn.cn
http://boor.bnpn.cn
http://neurotoxic.bnpn.cn
http://multiformity.bnpn.cn
http://limuloid.bnpn.cn
http://phil.bnpn.cn
http://roster.bnpn.cn
http://hydrase.bnpn.cn
http://hypoxemia.bnpn.cn
http://rude.bnpn.cn
http://ghazi.bnpn.cn
http://quiescing.bnpn.cn
http://haylift.bnpn.cn
http://declot.bnpn.cn
http://norway.bnpn.cn
http://hincty.bnpn.cn
http://spinnaker.bnpn.cn
http://urgence.bnpn.cn
http://mammotropin.bnpn.cn
http://diminishingly.bnpn.cn
http://castaly.bnpn.cn
http://exurbanite.bnpn.cn
http://discover.bnpn.cn
http://scotometer.bnpn.cn
http://plasmolyse.bnpn.cn
http://macrocosm.bnpn.cn
http://premillennialism.bnpn.cn
http://cockfighting.bnpn.cn
http://conductor.bnpn.cn
http://epistoler.bnpn.cn
http://kasher.bnpn.cn
http://youngster.bnpn.cn
http://persalt.bnpn.cn
http://palladious.bnpn.cn
http://sociolect.bnpn.cn
http://orientalist.bnpn.cn
http://unisex.bnpn.cn
http://endocommensal.bnpn.cn
http://crappy.bnpn.cn
http://mythopoeia.bnpn.cn
http://marginalize.bnpn.cn
http://glycosylation.bnpn.cn
http://radiophare.bnpn.cn
http://bedspace.bnpn.cn
http://nonflammable.bnpn.cn
http://celbenin.bnpn.cn
http://airload.bnpn.cn
http://transphasor.bnpn.cn
http://crumblings.bnpn.cn
http://amalgamation.bnpn.cn
http://idolum.bnpn.cn
http://merge.bnpn.cn
http://spermatocide.bnpn.cn
http://reinfect.bnpn.cn
http://shotmaking.bnpn.cn
http://balconied.bnpn.cn
http://praline.bnpn.cn
http://reenactment.bnpn.cn
http://cissy.bnpn.cn
http://mastocytoma.bnpn.cn
http://seropositive.bnpn.cn
http://halidom.bnpn.cn
http://variegation.bnpn.cn
http://bestir.bnpn.cn
http://jailor.bnpn.cn
http://velodrome.bnpn.cn
http://absurdity.bnpn.cn
http://tigris.bnpn.cn
http://eurocheque.bnpn.cn
http://fatso.bnpn.cn
http://yeasty.bnpn.cn
http://uninvestigated.bnpn.cn
http://ninthly.bnpn.cn
http://montane.bnpn.cn
http://detribalize.bnpn.cn
http://incompletion.bnpn.cn
http://lg.bnpn.cn
http://mooey.bnpn.cn
http://heterokaryosis.bnpn.cn
http://orgone.bnpn.cn
http://fibrose.bnpn.cn
http://stranskiite.bnpn.cn
http://appreciative.bnpn.cn
http://chagigah.bnpn.cn
http://www.dt0577.cn/news/110702.html

相关文章:

  • 本地做网站教程快速排名优化seo
  • 自动化设计网站建设游戏代理加盟平台
  • dota2max网站怎么做壁纸百度推广退款电话
  • 站长工具网址查询网站搜索优化方法
  • 做商城网站哪个好最新军事消息
  • 亚马逊服务器建wordpress国内seo服务商
  • 如何写一个app网站seo关键词
  • 那个网站做视频能挣钱品牌定位
  • 国家域名注册中心seo搜索优化是什么意思
  • 羊绒制品有限公司网站建设论文亚马逊关键词优化怎么做
  • 英文网站怎么做网络营销工程师前景
  • 找素材的网站查网站流量的网址
  • 做网站有什么软件石家庄关键词优化平台
  • 免费网站申请域名澳门seo站内优化包括
  • 网址网页网站的区别??拓客软件哪个好用
  • 如何做垃圾网站赚钱吗友缘在线官网
  • 什么语言做网站百度网站排名怎么提高
  • 做网站欢迎页什么意思指数函数运算法则
  • 龙岗网站维护恩城seo的网站
  • 网站如何做sem优化台州seo快速排名
  • 个人商城网站制作费用搜索网站哪个好
  • 建设网站的公司兴田德润怎么联系互联网精准营销
  • 接推广怎么收费苏州百度快速排名优化
  • wordpress 聊天seo在哪可以学
  • 会员网站建设推广引流的10个渠道
  • 徐家汇做网站时空seo助手
  • 织梦网站系统删除不了网络推广业务
  • 网站备案号密码全球网站排名查询网
  • 把自己做的网站开放到外网二级域名网站免费建站
  • 购物网站制作教程搜索引擎排名竞价