I want to update two fields of table (Store) from a select of others tables, but i don´t know how i can do it. The SQL system is in AS/400, so doesn´t have SQL Server or Oracle tricks :(
Here is the SELECT
, i want the price and amount of an order (article table join for select only existing articles)
SELECT OrderDetails.Price, OrderDetails.Amount
FROM (OrderHeader JOIN OrderDetails ON OrderHeader.Number = OrderDetails.Number)
JOIN Articles ON Article.Reference = OrderDetails.Article
WHERE OrderHeader.Store = 074
AND OrderHeader.Date = 2009-12-04
AND OrderHeader.Number = 26485
And here is the UPDATE
, i want update price and amount of each article from last SELECT
UPDATE Store
SET Store.Price = *****OrderDetails.Price*****
, Store.Amount = Store.Amount + *****OrderDetails.Amount*****
... ????
Thanks for the help, and excuse my Tarzan s english ;)