如何创建与SQLite.Swift等效的WHERE ... IN的SQL过滤器 [英] How to create a filter that does the SQL equivalent of WHERE ... IN for SQLite.Swift

查看:114
本文介绍了如何创建与SQLite.Swift等效的WHERE ... IN的SQL过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用多个值过滤同一列的结果

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

SQL中的示例:

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

这将返回状态为1且current_condition为"New"或"Working"的myTable的所有行

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

我如何在SQLite.swift中做到这一点?

how do I do this in SQLite.swift?

推荐答案

您可以在Swift中使用原始SQL.这样您就可以使用发布的字符串了.

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

原始SQL

使用过滤器

我使用过滤器,可以给我带来更多的见识.

I use Filters, gives me more insight.

这篇关于如何创建与SQLite.Swift等效的WHERE ... IN的SQL过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆