Oracle-update multiple row value where the the id column equals specific values -


i new in oracle , want update multiple row value column id = 1 , 2.

i tried :

update tester  set employee_phone_number = ( 0789456123,0789456321)   employee_id in (1,2);  

but gives me "missing right parenthesis"

any please , in advance.

another approach:

merge   tester using (   select 1 id,'0123456785' employee_phone_number dual union   select 2 id,'0123456786' employee_phone_number dual) new_values on (   tester.id = new_values.id) when matched update    set employee_phone_number = new_values.employee_phone_number; 

more words, allows values specified in 1 place , extends allow inserts id not exist.

http://sqlfiddle.com/#!4/8fc86/3


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -