亚音速 2.2 中的嵌套和/或表达
我需要进行如下查询:
SELECT * from TABLE
WHERE cola= "aaa"
and
(
(colb = "bbb" and (colc="ccc" or colc = "ddd"))
or
(colb="eee" and colc = "fff")
)
我尝试使用 Andexpression()
、orexpression()
、openexpress()
或 closeexpress()
,但我不明白! 任何帮助将不胜感激!
I need to make a query like :
SELECT * from TABLE
WHERE cola= "aaa"
and
(
(colb = "bbb" and (colc="ccc" or colc = "ddd"))
or
(colb="eee" and colc = "fff")
)
I tried with Andexpression()
, orexpression()
, openexpression()
or closeexpression()
, but i can't figure it out !
Any help would be appreciated !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WhereExpression
、AndExpression
等应该可以工作(另请参阅这个问题),但它并不总是对我有用。只要您的
Where
子句相对简单,您就可以添加一些重复并使用逻辑运算符优先级:这将导致如下结果:
WhereExpression
,AndExpression
etc. should work (see also this question), but it doesn't work for me all the time, neither.As long as your
Where
clauses are relatively simple, you could add some repetition and use logical operator precedence:This would result in something like this: