select
nvl(sum(nvl(t.xxxxxxx,0) * nvl(t.xxxxxxx,1) * nvl(tpdc.xxxxxxx,0)),0)
into sp_sum_fee
from intf_policy t
left join (select * from xxxxxxx
where (EXISTS(select * from xxxxxxxwhere xxxxxxx='0104') and xxxxxxx='0104')
or
( not EXISTS(select * from xxxxxxxwhere xxxxxxx='0104') and xxxxxxx=  '0104')) tpdc
on t.xxxxxxx= tpdc.xxxxxxx
left outer join xxxxxxxt1 on t.xxxxxxx= t1.person_code
left outer join xxxxxxxt2 on t1.sid = t2.pid and t.xxxxxxxbetween t2.start_date and t2.end_date
left outer join t_team t3 on t2.tid = t3.sid
where t1.person_code = 12121212
and t.fee_type = '2'
and to_date(to_char(t.biz_date,'yyyy-MM-dd'),'yyyy-MM-dd') between 2022-03-01 and 2022-03-31;

select
nvl(sum(nvl(t.xxxxxxx,0) * nvl(t.xxxxxxx,1) * nvl(tpdc.xxxxxxx,0)),0)
--into sp_sum_fee
from intf_policy t
left join (select * from xxxxxxx
where (EXISTS(select * from xxxxxxxwhere xxxxxxx='0104') and xxxxxxx='0104')
or
( not EXISTS(select * from xxxxxxxwhere xxxxxxx='0104') and xxxxxxx=  '0104')) tpdc
on t.xxxxxxx= tpdc.xxxxxxx
left outer join xxxxxxxt1 on t.xxxxxxx= t1.person_code
left outer join xxxxxxxt2 on t1.sid = t2.pid and t.xxxxxxxbetween t2.start_date and t2.end_date
left outer join t_team t3 on t2.tid = t3.sid
where t1.person_code = '12121212'
and t.fee_type = '2'
and to_date(to_char(t.biz_date,'yyyy-MM-dd'),'yyyy-MM-dd') between to_date('2022-03-01','yyyy-MM-dd') and to_date('2022-03-31','yyyy-MM-dd');

ORA-00905: 缺失关键字

这里姜老师把 --into sp_sum_fee 注释掉后就正常了

ORA-01722: 无效数字无效数字

然后注意 person_code = 12121212 给字符串加引号

ORA-00932: 数据类型不一致: 应为 DATE, 但却获得 NUMBER

然后 2022-03-01 要将字符串转为时间格式: to_date('2022-03-01','yyyy-MM-dd')

select nvl(sum(nvl(t.xxxxxxx,0) * nvl(t.xxxxxxx,1) * nvl(tpdc.xxxxxxx,0)),0) into sp_sum_fee from intf_policy t left join (select * from xxxxxxx where (EXISTS(select * from xxxxxxxwhere xxxxxxx='0104') and xxxxxxx='0104') or (... 你要插入的表A里,有外键连接到另一个表B的主键,你在表A的外键列插入的值,在表B的主键列找不到就不能插入。 主要看两表 的数据是否 一致 ,从表 要关联外键的字段 的数据必须包含在主表相关字段的数据内。 处理的方法有: 1> 先不验证已有数据的CONSTRANT,加上参数NOVALIDATE.*/
你的语句写错了,select maxlogid into oldmaxlogid from maxidtab; str1:='select max(logid) into newmaxlogid from '||username||'.loginfo'; --改成str1:='select max(logid) from'||username||'.loginfo'; execute imm
1、  遇到的问题 C:\Users\Administrator>expdp 'sys/system as sysdba' directory=backup full=y dumpfile=fullexp.dmp logfile=fullexp.log; Export: Release 10.2.0.3.0 - Production on Wednesday, 18 April, 2012 12:13:15 Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column ‘cs.remarks‘ in ‘f 10571 BeanCreationNotAllowedException异常:Error creating bean with name ‘rabbitConnectionFactory‘:的原因 BeanCreationNotAllowedException异常:Error creating bean with name ‘rabbitConnectionFactory‘:的原因 yourtoys: 我是新建mapper.xml时候出了问题 IDEA常用场景搜索快捷键(当前类、当前项目、全局) XCDH8: 打都打不开 IDEA常用场景搜索快捷键(当前类、当前项目、全局) XCDH8: 链接是什么玩意 电脑右下角系统时间精确显示到秒详细设置 fw小林要每天自省: 怎么换成可以管理者权限的运行啊,我直接搜regedit没有耶,倒是发现这个运行少了个管理者权限 解决Windows 10 家庭中文版没有组策略编辑器的问题 2201_75689431: 为什么我还是没有,必须保存在c盘根目录下吗