I am not very good at sql and I have tried several things. What would be the best way to combine these 5 update statements into one statement based on code performance ? It would be a great help. Thank you very much!
the code:
Update main_table
set a = (case
..some code.. end)
where condition_2;
Update main_table
set b = (case
..some code.. end)
where condition_2
Update main_table
set c = (select x from sec_table where conditon_1)
where condition_2
Update main_table
set d = (select y from sec_table where conditon_1)
where condition_2
Update main_table
set e = (select z from sec_table where conditon_1)
where condition_2
source
share