【发布时间】:2018-08-13 17:06:35
【问题描述】:
insert into time_test(Difference) values
(select ((select actual from time_test where id = :p13_id) -
(select
(monday+tuesday+wednesday+thursday+friday) from time_test where id=
:p13_id
)) from time_test where id= :p13_id)
Difference 是time_test 中为空的列,:p13_id 是 Oracle Apex 的页面项。
我知道我需要将它包装在 nvl 或类似的函数中,但我不知道如何。
【问题讨论】:
-
为什么要使用子查询?该值实际上是空的,还是没有匹配的行?您实际上是在正在查询的同一个表中插入一个新行 - 插入语句中只有一列 - 还是您实际上可能试图根据同一行中的其他值更新该列?
-
既然您质疑我想我正在尝试更新该行。
-
更新时间_测试集差异 = 实际 - (select(monday+Tuesday+Wednesday+ Thursday+Friday)) where id = :p13_id
标签: sql oracle oracle-apex oracle-apex-5.1