摘要: sql Case 仅仅返回第一个符合条件的值,剩下的Case部分将会被自动忽略。Case 的使用有两种格式:简单Case函数和Case搜索函数。简单Case 函数: Case sex when '1' then '女' when '2' then '男' else '其他' EndA: Case 表达式 when 表达式的一个值 then .... else ... when 表达式的一个值 then ....else End.B: Case 表达式 when 表达式一个值 then... when 表达... 阅读全文
posted @ 2014-02-21 13:28 想静一下 阅读(551) 评论(0) 推荐(0) 编辑
摘要: 当Null + 任何字符串时,都等于Null. 因些用函数IsNull(字段名,''),如果字段名中的值是Null时,那么这个字段名的值是''.例如::select code + IsNull('-'+Description,' ') from table1:当Description的值是Null 时,显示值是:Code .当Description 的值不是Null时,显示值是 code - Description. 阅读全文
posted @ 2014-02-21 12:05 想静一下 阅读(7694) 评论(0) 推荐(1) 编辑