I need help with an update query based on two tables.
The tables are linked with "stockid" field. The tables names are "sale items" and "products". There are multiple references of "stockid" in the "sale items" table, there is only one unique entry in the "products" field. I need to update the "costsale" field in "sale items" equal to the "averagecost" field in "products" tables.
Crude version of sql
update sale items set sale items.costsale=products.avecost
where sale items.stockid=products.stockid
The tables are linked with "stockid" field. The tables names are "sale items" and "products". There are multiple references of "stockid" in the "sale items" table, there is only one unique entry in the "products" field. I need to update the "costsale" field in "sale items" equal to the "averagecost" field in "products" tables.
Crude version of sql
update sale items set sale items.costsale=products.avecost
where sale items.stockid=products.stockid