select 姓名, 
       (case when 性别='M' then '男' else '女' end ) as 性别
from table1

解决方案 »

  1.   

    select 姓名 case 性别 when 'M' then '男' else ' 女' end as 性别
    from TABLE1iif是access的用法
      

  2.   

    if Object_id('table1') is not null drop table table1
    create table table1(姓名 varchar(10),性别 varchar(2))
    insert table1 select 'A','M' union select 'B','W'  union select 'C','M' union select 'D','W'
    select 姓名,case  性别 when 'M' then '男' when 'W' then '女' end as 性别 from table1
      

  3.   

    select 姓名, 
           (case when 性别='M' then '男' else '女' end ) as 性别
    from table1
      

  4.   

    select 姓名, 
           (case when 性别='M' then '男' else '女' end ) as 性别
    from table1