oracle apex的优缺点,Oracle Apex中的计算有问题吗?

一、 不知何故,怀疑那些表只包含您提到的列。他们都缺乏某种

ID

这将使加入成为可能。否则,那就没有意义了。

例如(连同一些示例数据):

SQL> create table product (product_id number, price number);

Table created.

SQL> create table bill (product_id number, quantity number, total_price number);

Table created.

SQL> insert all

2 into product (product_id, price) values (1, 100)

3 into product (product_id, price) values (2, 200)

4 into bill (product_id, quantity) values (1, 5)

5 select * from dual;

3 rows created.

SQL> select * from product;

PRODUCT_ID PRICE

---------- ----------

1 100

2 200

SQL> select * from bill;

PRODUCT_ID QUANTITY TOTAL_PRICE

---------- ---------- -----------

1 5

SQL> commit;

Commit complete.

total_price

列值,可以使用

UPDATE

SQL> update bill b set

2 b.total_price = (select b.quantity * p.price

3 from product p

4 where p.product_id = b.product_id

5 );

1 row updated.

SQL> select * From bill;

PRODUCT_ID QUANTITY TOTAL_PRICE

---------- ---------- -----------

1 5 500

SQL> rollback;

Rollback complete.

MERGE

:

SQL> merge into bill b

2 using (select p.product_id, p.price

3 from product p

4 ) x

5 on (b.product_id = x.product_id)

6 when matched then update set b.total_price = b.quantity * x.price;

1 row merged.

SQL> select * From bill;

PRODUCT_ID QUANTITY TOTAL_PRICE

---------- ---------- -----------

1 5 500

当你用一个顶点标记这个问题时,你实际上拥有什么还不清楚。这是什么样的一页?如果它是一个报表(经典的或交互式的),您可以在

product_id

SQL> select b.product_id, b.quantity, p.price, b.quantity * p.price as total_price

2 from product p join bill b on b.product_id = p.product_id;

PRODUCT_ID QUANTITY PRICE TOTAL_PRICE

---------- ---------- ---------- -----------

1 5 100 500

如果是表单页,则使用动态操作

设置值

P1_PRICE

和/或

P1_QUANTITY

P1_TOTAL_PRICE

:P1_PRICE * :P1_QUANTITY

基本上,有很多选择。你要用的那个取决于你真正拥有什么。

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值