I want to construct a query like this:
SELECT * FROM t1 WHERE visible=’yes’ AND IF (sale = ‘yes’, quantity > 0)
It is my goal is to receive only the rows from the table with quantity more then 0 only when it is a ‘sale’ product. I tried IF and CASE statements but it seems that the result of these can only by a string of integer, not a statement.
I am stuck here…
1 Answer