1
I am performing a query to change the net cost of a product according to a brand, however, I get the following error message:
Subquery returned more than 1 value. This is not permitted when the subquery Follows =, != , <, <= , >, >= or when the subquery is used as an Expression. The statement has been terminated.
I tried to:
UPDATE cd_pro
SET CustoLiquido = ((10 * p.CustoLiquido) / 100) + p.CustoLiquido
FROM cd_pro p
INNER JOIN cd_marcas m
ON (p.id_marca = m.id_marca)
WHERE m.id_marca = 1
The query
SELECT p.CustoLiquido FROM cd_pro p INNER JOIN cd_marcas ON (p.id_marca = m.id_marca) WHERE m.id_marca = 1
is returning more than one value, so there is no way to do the UPDATE using the operation((10 * p.CustoLiquido) / 100) + p.CustoLiquido
. Refactor your query to return only 1 value.– Andre Gusmao