开发者社区 问答 正文

case表达式中其他例子有哪些?

case表达式中其他例子有哪些?

展开
收起
游客gzyuldo4mrg6i 2022-03-29 19:33:58 695 分享 版权
1 条回答
写回答
取消 提交回答
  • select case (select count(*) as s1 from t1 where a = 1)

    when (select count(*) as s2

    from t1, t2

    where t1.a = t2.a

    and t2.a = 1) then

    '相等'

    else

    '不相等'

    end

    from dual;

    2022-03-29 19:34:34
    赞同 展开评论
问答地址: