开发者社区 问答 正文

WHERE子句中的CASE语句用于不同和

我可以使用case语句在这样的地方构建吗?

select * from table where case when x=y then z= j and t=v when x=k then q= p and s=l end ; 我需要根据x变量的值更改where子句。

问题来源于stack overflow

展开
收起
保持可爱mmm 2019-11-15 17:15:01 422 分享 版权
1 条回答
写回答
取消 提交回答
  • 用途or:

    select * from table where (x = y and z = j and t = v) or (x = k and q = p and s = l);

    2019-11-15 17:15:17
    赞同 展开评论
问答地址: