SQL performing wrong query

Asked

Viewed 28 times

0

I am trying to identify which products in stock have reached the minimum capacity or are below it.

I tried it this way:

SELECT * FROM produtos WHERE quantidade_minima <= quantidade

And I get the following result:

inserir a descrição da imagem aqui

As you can see quantity is greater than minimum quantity_and yet it is evaluated as less or equal, which may cause this wrong evaluation?

1 answer

4


I think the right query would be:

SELECT * FROM produtos WHERE quantidade <= quantidade_minima

Browser other questions tagged

You are not signed in. Login or sign up in order to post.