select id,case when cash is null then 'N' else 'Y' end as cash
from tablename

解决方案 »

  1.   

    select id,case when isnull(cash,0) > 0 then 'Y' else 'N' end cash
    from yourTable
      

  2.   

    select id,case when cash is null then 'N' when cash = '' then 'N' else 'Y' end as cash
    from tablename
      

  3.   

    select id,case when cash>'' then 'y' ELSE 'N' end as cash
    from tablename
      

  4.   

    最简单的写法
    select id,case when cash >'' then 'Y' else 'N' end as cash
    from tablename