我需要你帮助对一个大表(大约50亿行-基于oracle11g)进行sql更新。我使用sql plus从shell脚本生成并执行更新,但执行查询需要花费大量时间,有没有办法加快更新速度:
Update My_table
Set CODE = ‘F’ where date=’2020/06/05’ and ID=’87444’ and GROUP=’GGG’ and NUM_FAC=’15444’
Update My_table
Set CODE = ‘D’ where date=’2020/06/01’ and ID=’85544’ and GROUP=’GGG’ and NUM_FAC=’55555’
Update My_table
Set CODE = ‘I’ where date=’2020/06/03’ and ID=’85544’ and GROUP=’GGG’ and NUM_FAC=’55555’
….. Plusieurs lignes
Commit ; ```
Exit SUCCESS
Thank you in advance for your help.
1条答案
按热度按时间1tuwyuhd1#
将常见条件移至
WHERE
子句,然后使用CASE
表达式: