求 where 有关问题

求 where 问题

select *, IF(isnull(price1),price2, price1) as price

from goods

where price>100

会有一个问题Unknown column ‘price’ in ‘where clause’,这个price字段本身不存在,求实现语句。



select * from (

select *, IF(isnull(price1),price2, price1) as price

from goods) A

where price>100

OR

select *, IF(isnull(price1),price2, price1) as price

from goods

where IF(isnull(price1),price2, price1)>100

求 where 有关问题

相关文章:

你感兴趣的文章:

标签云: