使用 case when ... else .... end  as  sth 实现例子:select * ,
case when 价格 = 0 then '面议' else 价格字段的值 end as 价格
from table
where ...

解决方案 »

  1.   

    SQL中好像不支持iif语句,可以使用case语句代替
    select 显示=(case when 价格=0 then '面议' else char(价格) end) from ...
      

  2.   

    看你在那里用了,如果是在VFP中的话
    sele xm as 姓名,sum(IIF(xb="男",1,0)) as 男生人数 from xsb
    呵呵,这样就可以了,不过在SQL查询分析器中,上面的一定不行的!