How to create a filter that does the SQL equivalen

2019-09-10 23:52发布

问题:

I would like to filter results for the same column with multiple values

example in sql:

SELECT * FROM myTable WHERE status = 1 AND current_condition = ("New", "Working")

this will return all rows from myTable where the status is 1 and the current_condition is "New" OR "Working"

how do I do this in SQLite.swift?

回答1:

You can use raw SQL in Swift. So you can use the string you posted.

Raw SQL

Using Filters

I use Filters, gives me more insight.