UPDATE statement with multiple joins in PostgreSQL

前端 未结 5 1805
说谎
说谎 2021-01-07 18:16

I\'m trying to update a table called incode_warrants and set the warn_docket_no to the viol_docket_no from the incode_violations

5条回答
  •  失恋的感觉
    2021-01-07 18:39

    UPDATE incode_warrants iw
         SET warn_docket_no = iv.viol_docket_no
    FROM incode_warrantvs AS iwvs, incode_violations AS iv 
    WHERE iv.viol_citation_no = iwvs.warnv_citation_no AND
          iv.viol_viol_no = iwvs.warnv_viol_no AND
          iw.warn_rid = iwvs.warnv_rid;
    

提交回复
热议问题