SQL中CASE的 用法

来源:百度知道 编辑:UC知道 时间:2024/05/08 13:33:52
case when (t1.FGroup = '我爱'or a.FEmpID IN (23804002,23804004,23804007,24793001)) then sum(a.FQty) end as FPiece1,
中的'24793001'要再进行判断后才能使用应该怎么弄啊。
(case when t3.FInterID = 20014765 and a.FEmpID = 24793001 end as FPiece1)

循环嵌套。
CASE input_expression1
WHEN when_expression1
THEN { CASE input_expression2
WHEN when_expression2
THEN result_expression2
}

---------------------------------------------------------

下面这个地址有case的各种用法
http://www.51iter.com/program/database/sql/200604/program_30970.html