IN (SELECT …) documentation

This commit is contained in:
Gwendal Roué committed 2016-02-07 15:32:28 +01:00
1 parent 09c599cc62
commit 9a2b7cbefc
1 file changed
+9
+9
View File
@@ -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