oracle 缺失关键字_oracle数据库中 错误: ORA-0095:缺失关键字

selectt.project_id,b.project_name,sum(casewhent.age='50~59'then1else0end)male,--50~59sum(casewhent.age='60~69'then1else0end)female,--60~69sum(casewhent.age='70~79'then1el...

select t.project_id, b.project_name, sum(case when t.age='50~59' then 1 else 0 end ) male,--50~59 sum(case when t.age='60~69' then 1 else 0 end ) female,--60~69 sum(case when t.age='70~79' then 1 else 0 end ) unknown--70~79 from ( select c.project_id,case length(p.d204a010005) when 18 then trunc((to_char(sysdate, 'yyyyMMdd')-to_char(to_date(substr(p.d204a010005,7,8),'yyyy-MM-dd'),'yyyyMMdd'))/10000) else when 15 then trunc((to_char(sysdate, 'yyyyMMdd')-to_char(to_date(substr(p.d204a010005,7,8),'yyyy-MM-dd'),'yyyyMMdd'))/10000) end as age from ensure_commission c left join d204a01 p on c.commission_id=p.commission_id where c.submit_organ_id like '%%' ) t left join ensure_pro_book b on t.project_id=b.project_idgroup by t.project_id,b.project_name

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值