sql查询语句问题 有一张表有多个字段,其中一个字段的记录值为1的时候,需要查询出来显示为“√”。语句怎么写呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select *,case when col = 1 then '√' else '' end as othercolfrom ta SELECT CASE WHEN COL1 =1 THEN '√' ELSE '' ENDFROM TB select *, case when col = 1 then '√' else '' end as othercol from ta select *,列=case when 字段=1 then '√' end from 表 select *,字段=case 字段 when 1 then '√' else 字段 end from 表 select *, case when col = 1 then N'√' else '' end as othercol from ta最好加个N'' select *,字段=case 字段 when 1 then '√' else 字段 end from 表 select *, case when col = 1 then '√' else '' end as othercol from ta 太简单了!呵呵!只要是字符都能显示!如果要将字符加上数值型数据的话,需要用CASET,CONVERT将数值型数据转换为字符型! 感谢!在access上报错浪费了很多时间,在sql2000上没问题。 资金的收支累计。应该怎么设计 搞不懂,明明相同的,可就是查询不出来 如何提取字段中制定的信息 请各位老大帮我看看这个查询语句,查不出结果. 如何写sql取得距离某一时间最近的值? sqlserver2008的 查询分析器如何执行外部os命令 ADO数据库查询 请问如何优化表的数据输出速度 如何将两个表的数据用一个存储过程来提交? 增加列的问题 写SQL语句? 一个查询SQL怎么写
case when col = 1 then '√' else '' end as othercol
from ta
FROM TB
select *,
case when col = 1 then '√' else '' end as othercol
from ta
select *,列=case when 字段=1 then '√' end from 表
case when col = 1 then N'√' else '' end as othercol
from ta最好加个N''
case when col = 1 then '√' else '' end as othercol
from ta 太简单了!呵呵!只要是字符都能显示!如果要将字符加上数值型数据的话,需要用CASET,CONVERT将数值型数据转换为字符型!