query - problem

E

evagelos

i have 2 tables:
1st: 2nd
STOCK STOCKMOV
& CODE_STOCK CODE_PARAS
QUANTITY_LEFT CODE_STOCK
TOTAL_QUANT

in the first the pr.key is the CODE_STOCK
in the second the pr.key is the CODE_PARAS
One invoice may have more than one CODE_STOCK and may also have many times
the same CODE_STOCK (with different price)
i want to make a query to summarize the STOCKMOV.TOTAL_QUANT group by
STOCKMOV.CODE_STOCK and the result to update the STOCK table
i have make so far without success:


UPDATE STOCK INNER JOIN STOCKMOV ON STOCK.CODE_STOCK = STOCKMOV.CODE_STOCK
SET STOCK.STOCK.APOGR_POSO = (SELECT Sum(STOCKMOV.POSOTHTA)
FROM STOCKMOV
GROUP BY STOCKMOV.CODE_STOCK)


Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top