select 姓名 case 性别 when 'M' then '男' else ' 女' end as 性别 from TABLE1iif是access的用法
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
select 姓名, (case when 性别='M' then '男' else '女' end ) as 性别 from table1
select 姓名, (case when 性别='M' then '男' else '女' end ) as 性别 from table1
from TABLE1iif是access的用法
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
(case when 性别='M' then '男' else '女' end ) as 性别
from table1
(case when 性别='M' then '男' else '女' end ) as 性别
from table1