How to create a filter that does the SQL equivalent of WHERE … IN for SQLite.Swift

∥☆過路亽.° 提交于 2019-12-12 03:28:16

问题


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.



来源:https://stackoverflow.com/questions/36126350/how-to-create-a-filter-that-does-the-sql-equivalent-of-where-in-for-sqlite-s

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!