下面是在编译这句代码时报的错误:
update hml_test_table set
ced=(
(select sum(nvl(SUBCONTRACTING_FEE, 0)) from statements_all_cost_item
where province = '吉林' and now_month='201310' )
+
(select nvl(SUB, 0) from statements_project_cost
where province = '吉林' and now_month=to_char(to_number('201310')-1) and status = 'Q1')
);
上面的代码编译时报ora-00907:缺失右括号
如果我这样写就不报错:
select
(select sum(nvl(SUBCONTRACTING_FEE, 0)) from statements_all_cost_item
where province = '吉林' and now_month='201310' )
+
(select nvl(SUB, 0) from statements_project_cost
where province = '吉林' and now_month=to_char(to_number('201310')-1) and status = 'Q1')
from dual;
有哪位朋友帮忙看看,在线等您的帮助,O(∩_∩)O谢谢
写oracle存储过程时报ora-00907:缺失右括号
答案:2 悬赏:20 手机版
解决时间 2021-03-02 09:07
- 提问者网友:杀手的诗
- 2021-03-01 08:28
最佳答案
- 五星知识达人网友:猎心人
- 2021-03-01 08:47
试试这样
update hml_test_table set
ced=(SELECT
(select sum(nvl(SUBCONTRACTING_FEE, 0)) from statements_all_cost_item
where province = '吉林' and now_month='201310' )
+
(select nvl(SUB, 0) from statements_project_cost
where province = '吉林' and now_month=to_char(to_number('201310')-1) and status = 'Q1')
FROM dual
);
update hml_test_table set
ced=(SELECT
(select sum(nvl(SUBCONTRACTING_FEE, 0)) from statements_all_cost_item
where province = '吉林' and now_month='201310' )
+
(select nvl(SUB, 0) from statements_project_cost
where province = '吉林' and now_month=to_char(to_number('201310')-1) and status = 'Q1')
FROM dual
);
全部回答
- 1楼网友:封刀令
- 2021-03-01 10:03
2014dg是什么,表名吗?你的表名怎么用数字开头啊?
如果是的话,应该用 双引号引起来:
select syxs from newjw."2014dg" where ...
注意引起来后"2014dg"的dg是大写还是小写,一点要看区别。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯