小编SSA*_*SAT的帖子

oracle case语句返回多个字符

您好,请更正我的查询


select * from table S1
WHERE  S1.stu ='12345'
AND S1.sem = (Select Case When col2 > col4 Then col2 Else col4 End From table2)
And S1.met1 in  (case when (S1.sem = 1) then ('1', 'D', 'F' )
                      when (S1.sem = 2) then ('1', '5', '7',  )
                      when (S1.sem = 3) then ('1',  'D', 'F' )
                      else s1.sem end);
Run Code Online (Sandbox Code Playgroud)

因为与表结合而应该使用case.我明白了

错误:缺少关键字

对于此查询

sql oracle case

0
推荐指数
1
解决办法
47
查看次数

标签 统计

case ×1

oracle ×1

sql ×1