谁帮我想想这个sql语句怎么写 假如 select name from t where name= 'xiaoming' 没有一条符合条件的记录 我怎么在sql里 name字段显示 “无符合” 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 bit 类型 true 符合 false 不符合 检索不符合的、、 本人不懂 能不能写个完整的sql语句啊 SELECT CASE WHEN name <> '001' THEN '不符合' else name end FROM tb if(exists(select 1 from t where name= 'xiaoming' )) select * from t where name= 'xiaoming' else select '无符合' select distinct(case when name<>'经理'then'无符合' else name end) as namefrom t select distinct case when name='xiaoming' then name else '无符合' end from t select name from t where name='xiongming'.. if(exists(select 1 from t where name= 'xiaoming' )) select * from t where name= 'xiaoming' else select '无符合' select isnull(name,'无符合') from t where name= 'xiaoming' O(∩_∩)O~ 刚学 sql 过来学习学习 把name的默认值设成“无符合”,无符合条件的不修改 推荐给你去看看:http://hi.csdn.net/space-3834954-do-thread-id-3068.html if(exists(select 1 from t where name= 'xiaoming' )) select Name from t where name= 'xiaoming' else select '无符合' As Name 虽然回复了很多,但都写得不够好。这是最简单的SQL写法:select ISNULL(MAX(name),'无符合') from t where name= 'xiaoming' select(case when (select count(name) from t where name= 'xiaoming') = 0 then '无符合' else name end) name from t where name = 'xiaoming' 要是楼主用的不是Sql server数据库,上面的全部熄火,嘿嘿 看来SQL SERVER数据库还是挺火的 windows服务程序运行出现问题“服务启动后又停止” “穿越火线” 自动准备的原理是什么呀? 关于批处理处理数据库更新的问题 用C#怎样实现下面的功能呢? 请教 datagrid 查询 为什么老显示INSERT INTO语法错误.. C#的问题关于数据库操作和类的继承、重写 winform listview 如何控制每行数量 try finally 大数据访问问题 在C#中隐藏窗口的标题栏(同时保持窗口的Sizeable性能) c#制作记事本 急急!!!
CASE WHEN name <> '001' THEN '不符合'
else name end
FROM tb
if(exists(select 1 from t where name= 'xiaoming' ))
select * from t where name= 'xiaoming'
else
select '无符合'
from t
select * from t where name= 'xiaoming'
else
select '无符合'
if(exists(select 1 from t where name= 'xiaoming' ))
select Name from t where name= 'xiaoming'
else
select '无符合' As Name
(case when
(select count(name) from t where name= 'xiaoming') = 0 then '无符合'
else name
end
) name from t where name = 'xiaoming'