southbeach
Programmer
I have read but cannot see how to apply a JOIN to an UPDATE ...
I am trying to update a header table with the sum from a second table. Here is my query
I am getting an error
Searched for error 1111 but got so many results ... after scanning through them, none are related to what I am trying to do.
How can I do what I am attempting to?
Thanks!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
I am trying to update a header table with the sum from a second table. Here is my query
Code:
UPDATE products SET
products.prodReserved = SUM(productsd.pdQtyRes),
products.prodOnHand = SUM(productsd.pdQtyOnh),
products.prodAvailable = SUM(productsd.pdQtyAvl)
WHERE products.prodDicID = productsd.pdDicID
Code:
SQL query:
UPDATE products,
productsd SET products.prodReserved = SUM( productsd.pdQtyRes ) ,
products.prodOnHand = SUM( productsd.pdQtyOnh ) ,
products.prodAvailable = SUM( productsd.pdQtyAvl ) WHERE products.prodDicID = productsd.pdDicID
MySQL said: Documentation
#1111 - Invalid use of group function
Searched for error 1111 but got so many results ... after scanning through them, none are related to what I am trying to do.
How can I do what I am attempting to?
Thanks!
--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.