select *, IF(isnull(price1),price2, price1) as price
from goods
where price>100会有一个问题Unknown column 'price' in 'where clause',这个price字段本身不存在,求实现语句。
from goods
where price>100会有一个问题Unknown column 'price' in 'where clause',这个price字段本身不存在,求实现语句。
调试欢乐多
select *, IF(isnull(price1),price2, price1) as price
from goods) A
where price>100ORselect *, IF(isnull(price1),price2, price1) as price
from goods
where IF(isnull(price1),price2, price1)>100