postgresql: update column from another table's column

UPDATE c_order SET
po_refernce_no = (SELECT po_refernce_no FROM "Import" WHERE c_order_id = c_order.c_order_id),
tracking_number = (SELECT tracking_number FROM "Import" WHERE c_order_id = c_order.c_order_id)

 

 

UPDATE m_product
SET
manufacturer = (SELECT m_product_po.manufacturer FROM m_product_po WHERE m_product.m_product_id = m_product_po.m_product_id )

Leave a Reply

Your email address will not be published. Required fields are marked *