mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
IN (SELECT …) documentation
This commit is contained in:
1 parent
09c599cc62
commit
9a2b7cbefc
1 file changed
+9
@@ -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
|
||||
|
||||
Reference in new issue
Block a user