squeryl写的正确语法是什么?

时间:2018-05-03 08:24:15

标签: scala orm squeryl

编写像这样的squeryl的sql的正确语法是什么:
select * from table where (colA = 'value1' or colA = 'value2' ) and colB = 'value3'
???

1 个答案:

答案 0 :(得分:0)

Nesting Sub Queries下的示例表明您应该使用简单的andor。你试过这个吗?我的意思是直截了当的:

table.where(t =>
    ((t.colA === "value1") or (t.colA === "value2"))
     and (t.colB === "value3"))

这样的代码似乎对我来说很好。