【发布时间】:2021-06-26 12:51:03
【问题描述】:
我有一张桌子:
id| name | organisation_name|flag |priority|salary
1 | Mark | organisation 1 |null |1 |100.00
2 | Inna | organisation 1 |null |2 |400.00
3 | Marry| organisation 1 |null |3 |500.00
4 | null | organisation 1 |250.00|null |null
5 | Grey | organisation 2 |null |1 |600.00
6 | Holly| organisation 2 |null |2 |400.00
8 | null | organisation 2 |150.00|null
该程序应按优先级从特定组织的工资中扣除该标志。上面的结果如下。 结果:
id| name | organisation_name|flag |priority|salary
1 | Mark | organisation 1 |null |1 |0.00
2 | Inna | organisation 1 |null |2 |250.00
3 | Marry| organisation 1 |null |3 |500.00
4 | null | organisation 1 |250.00|null |null
5 | Grey | organisation 2 |null |1 |450.00
6 | Holly| organisation 2 |null |2 |400.00
8 | null | organisation 2 |150.00|null
我为此创建了 Pl/sql 块,但是在一百万条记录上速度太慢了。 最快的方法是什么?
【问题讨论】:
标签: stored-procedures plsql oracle11g oracle-sqldeveloper plsql-package