I want to update a colume using results from an select query but its not working :( my code:
UPDATE goods
SET goods.wagons_needed = (SELECT (goods.QUANTITY * WEIGHT) / max_payload as wneed
FROM GOODS INNER JOIN wagon_type
ON goods.wagon_type_id = wagon_type.wagon_type_id
order by goods.goods_id)
where goods.goods_id = goods.goods_id;
Thanks for any help.