I have a product table and I want to calculate the profit margin based on the columns preco_venda
and preco_custo
done as below:
update produto set margem_lucro=((((preco_unit/preco_custo)*100)-100))
Error occurs
ERROR: division by zero
ERROR: division by zero SQL state: 22012
What's wrong?