I am trying to update table supplement with the lowest price and company found in suppprice and I get errors. Any idea why?
SQL query:
UPDATE supplement set( supp_lprice, supp_lcomp ) = ( SELECT min( suppp_price ) , company_id
FROM suppprice
WHERE supplement.supp_id = suppprice.supp_id
GROUP BY supp_id )
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(supp_lprice, supp_lcomp) = (select min(suppp_price),company_id from suppprice ' at line 1
SQL query:
UPDATE supplement set( supp_lprice, supp_lcomp ) = ( SELECT min( suppp_price ) , company_id
FROM suppprice
WHERE supplement.supp_id = suppprice.supp_id
GROUP BY supp_id )
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(supp_lprice, supp_lcomp) = (select min(suppp_price),company_id from suppprice ' at line 1