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
Post a Comment