AI Joes
AI Joes

Reputation: 69

what is the correct syntax for squeryl to write or and?

What is the correct syntax to write sql like this squeryl:

select * 
    from table
      where 
        (colA = 'value1' or colA = 'value2' )
         and colB = 'value3'

???

Upvotes: 0

Views: 98

Answers (1)

SergGr
SergGr

Reputation: 23788

The example under the Nesting Sub Queries suggests that you should use simple and and or. Have you tried this? I mean something straightforward like:

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

Code like this seems to work fine for me.

Upvotes: 1

Related Questions