急!一条查询的sql语句 如何在数据库表中查询性别的取值,如果为‘M’,显示‘男’,如果为‘F’,显示‘女’? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select case col when 'M' then '男' else '女' end as 性别 from tb select (case sex_col when 'M' then '男' when 'F' then '女' end) [性别] from tab SELECT 性别=case when col='M' then '男' when col='F' then '女' end from tb select case col when 'M' then '男' else '女' end as 性别 from tb 楼上正解,做简单说明,“性别”为查询结果的列名,"col"为数据表中的列名 SELECT case col when 'M' then '男' when 'F' then '女' end from tb select case col when 'M' then ‘男’ when ‘F’ then ‘女’ end from tb select case col when 'M' then '男' else '女' end as 性别 from tb 如果需要了解sql server如何存储int型/datetime型的,那么请看 限定字段生成 高分求解数据建模问题 请教复杂SQL怎么写,急急 sql 两表格查询 ####应该是超简单问题:如何修改字段名#### 问下这样的密文是用什么方式加密的,以前的老系统,源代码不见了,想看看功能,SQL数据库来的。 SQL2000 如何合并while语句产生的多表返回值 SQL Server2000 企业版有没有办法在98下安装 primary key foreign key和unique 有什么不同? delete触发器 关于sql2005的超时问题
when 'M' then ‘男’
when ‘F’ then ‘女’
end
from tb