Error in update sql: Subquery returned more than 1 value. This is not permitted when the subquery follows

1

I am doing a query to change the net cost of a product according to a brand, but I get the following error message:

  

Subquery returned more than 1 value. This is not permitted when the   subquery follows =,! =, & lt ;, < =, & gt ;, > = or when the subquery is used as   an expression. The statement has been terminated.

I've tried:

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
    
asked by anonymous 10.01.2018 / 12:56

1 answer

0

Make direct:

UPDATE cd_pro
SET CustoLiquido = ((10 * CustoLiquido) / 100) + CustoLiquido
WHERE id_marca = 1

As you want to do for the brand and you have the id_marca in the cd_pro table, you do not have to do the join.

    
16.01.2018 / 02:16