I have two tables
app_detail_quot_s
-----------+--------------+
part_id +unit_price +
-----------+--------------+
1 + 100.000 +
2 + 200.000 +
3 + 300.000 +
app_supp_po_dt
-----------+--------------+
part_id +unit_price +
-----------+--------------+
1 + null +
2 + null +
8 + null +
the result after query update executed is
app_supp_po_dt
-----------+--------------+
part_id +unit_price +
-----------+--------------+
1 + 100.000 +
2 + 200.000 +
8 + null +
how to UPDATE all unit_price when part_id between app_detail_quots and app_supp_po_detail is equal in just one action using PostgreSQL?
I am trying this code:
update app_supp_po_dt set
unit_price =
(
select unit_price from app_detail_quot_s a left join app_supp_po_dt b on a.part_id= b.part_id
)
But I get error :
more than one row returned by a subquery used as an expression