select case when 成绩>60 then 'Pass' else 'Not Pass' end from 表
case是什么东西呢。。是语法吗?
CASE 函数,详细说明与使用 联机丛书,索引:CASE 函数
select case when 成绩 >60 then 'Pass ' else 'Not Pass ' end as '标识'from 表
> case是什么东西呢。。是语法吗?记得有的老外把棺材也叫做case的, 嘿嘿.
判断的语法: CASE 计算条件列表并返回多个可能结果表达式之一。 CASE 具有两种格式: 简单 CASE 函数将某个表达式与一组简单表达式进行比较以确定结果。 CASE 搜索函数计算一组布尔表达式以确定结果。 两种格式都支持可选的 ELSE 参数。 case when 条件='' then .. when 条件='' then ... else ... end--也可省略else
case是sql sever中的函数啊. 相当于oracle 中的decode函数啊具体可以看一下联机帮助select case when 成绩 >60 then 'Pass ' else 'Not Pass ' end from 表
select case when 成绩 >60 then 'Pass ' else 'Not Pass ' end from 表
联机丛书,索引:CASE 函数
CASE
计算条件列表并返回多个可能结果表达式之一。 CASE 具有两种格式: 简单 CASE 函数将某个表达式与一组简单表达式进行比较以确定结果。
CASE 搜索函数计算一组布尔表达式以确定结果。
两种格式都支持可选的 ELSE 参数。 case when 条件='' then .. when 条件='' then ... else ... end--也可省略else
相当于oracle 中的decode函数啊具体可以看一下联机帮助select case
when 成绩 >60 then 'Pass '
else 'Not Pass '
end
from 表
when 成绩 >60 then 'Pass '
else 'Not Pass '
end
from 表