From 9a2b7cbefca8de93969493d0f47ee3046571cd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 7 Feb 2016 15:32:28 +0100 Subject: [PATCH] =?UTF-8?q?`IN=20(SELECT=20=E2=80=A6)`=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 6c9822cb0..8e845f992 100644 --- a/README.md +++ b/README.md @@ -1975,6 +1975,15 @@ Feed [requests](#requests) with SQL expressions built from your Swift code: ``` > :point_up: **Note**: SQLite string comparison, by default, is case-sensitive and not Unicode-aware. See [string comparison](#string-comparison) if you need more control. + + To check inclusion in a sub query, calls the `contains` method on another request: + + ```swift + // SELECT * FROM "events" + // WHERE ("userId" IN (SELECT "id" FROM "persons" WHERE "verified")) + let verifiedUsers = User.filter(Col.verified) + Event.filter(verifiedPersonIds.select(Col.id).contains(Col.userId)) + ``` #### SQL Functions