how to use update with join condition on 3 tables in postgresql -


update patient  set p.patient_name='keerthi', c.pat_cnt_pincode=560765 patient p          left join patient_contact c on c.pat_cnt_email_id=p.patient_email            p.patient_id=921; 

you can update 1 table in single statement. but, do:

with p (       update patient p           set patient_name = 'keerthi'           p.patient_id = 921       returning *      ) update patient_contact pc     set pat_cnt_pincode = 560765     p     pc.pat_cnt_email_id = p.patient_email; 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -