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

帆软FCP开发认证模拟第二题

原题目
在这里插入图片描述

数据库查询结果
在这里插入图片描述

with base_data as (
select  id,part,        substr(part, 1, instr(part || ';', ';') - 1) code,substr(part, instr(part || ';', ';') + 1) as remaining
from chq3g4
where part != '' AND part IS NOT NULL
),
all_data as (
select id,code from base_data
union all
select  '12' as id, remaining as code from base_data where remaining!=''
),
area_data as (
select id,substr(code,0,instr(code,':')) as area
from all_data where area!=''
),
area_temp_data as (
select id,substr(code,0,instr(code,':')) as area
from all_data where area=''
),
category_data as (
select id,code,substr(code,instr(code,':')+1,2) as category,substr(code,instr(code,':')+4) as category_after
from all_data where id not in (select id from area_temp_data)
),
num_data as (
select id,category_after,substr(category_after,0,instr(category_after,':')) as num,substr(category_after,instr(category_after,':')+1) num_after
from category_data
),
base_result as (
select t1.id,      t3.area,t2.category,if(num='',0,num) as num,if(num_after='','20151220',num_after) as date_strfrom num_data t1
left join category_data t2 on t1.id=t2.id
left join area_data t3 on t1.id=t3.id
),
handler_data as (
select case when area='225100' then '上海'when area='225200' then '江苏'when area='225300' then '浙江'end as city,category,num, date_str,substr(date_str,1,4)||'-'||substr(date_str,5,2)||'-'||substr(date_str,7) as  shift_date
from base_result
)
select city,category,num,date_str,shift_date
from handler_data
where 1=1
--AND shift_date >= '${shift_date_start}'
--AND shift_date <= '${shift_date_end}'在这里插入代码片

帆软结果
在这里插入图片描述
在这里插入图片描述


```xml
select city,category,num,date_str,shift_date,case when category='01' then '分类01'when category='02' then '分类02'when category='03' then '分类03'end as category_
from handler_data
where 1=1
AND shift_date >= '${shift_date_start}'
AND shift_date <= '${shift_date_end}'

在这里插入图片描述

http://www.dtcms.com/a/403111.html

相关文章:

  • 做网站打印费复印费清单中方建设局网站
  • PyTorch DataLoader 接受的返回值类型
  • rust slint android 安卓
  • 网站后台建设怎么进入超级优化小说
  • 游戏对象AI类型释义
  • Harnessing Text Insights with Visual Alignment for Medical Image Segmentation
  • 网上做网站 干对缝儿生意外贸网站推广优化
  • 【Java后端】MyBatis 和 MyBatis-Plus (MP) 的区别
  • iOS PPBluetoothKit接入无法找到头文件问题
  • leetcode orb slam3 3/99--> leetcode49 Group Anagrams
  • c# 读取xml到datagridview
  • 开源的 CSS 动画库
  • (三)过滤器及组件化开发
  • [NewBeeBox] A JavaScript error occurred in the main process
  • 【LangGraph】ReAct构建-LangGraph简单实现
  • 做毕业设计哪个网站好网站怎样做百度推广
  • Python高效合并Excel多Sheet工作表,告别繁琐手动操作
  • 自动跳转到wap网站外贸网站建设制作设计案例
  • 【Linux】 服务器无 sz 命令时的文件传输和日志查看方案
  • 【TVM 教程】设置 RPC 系统
  • 在ssh远程连接的autodl服务器(中国无root权限服务器)上使用copilt的Claude模型
  • Ansible 自动化运维:集中化管理服务器实战指南
  • 自动化运维工具 Ansible 集中化管理服务器
  • 【好玩的开源项目】使用Docker部署LMS轻量级音乐服务器
  • Netty从0到1系列之RPC通信
  • Coze源码分析-资源库-创建数据库-后端源码-安全与错误处理
  • LeetCode:52.腐烂的橘子
  • LeetCode算法日记 - Day 52: 求根节点到叶节点数字之和、二叉树剪枝
  • 四种方法解决——力扣189.轮转数组
  • ⸢ 伍-Ⅱ⸥ ⤳ 默认安全治理实践:水平越权检测 前端安全防控