mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
README.md
This commit is contained in:
1 parent
8173b31df9
commit
162bdff3ee
1 file changed
+2
-2
@@ -802,9 +802,9 @@ Yet, it does a few things well:
|
||||
|
||||
```swift
|
||||
let persons = Person.fetchAll(db,
|
||||
"SELECT persons.*, COUNT(*) AS citizenshipsCount " +
|
||||
"SELECT persons.*, COUNT(citizenships.isoCode) AS citizenshipsCount " +
|
||||
"FROM persons " +
|
||||
"JOIN citizenships ON citizenships.personId = persons.id " +
|
||||
"LEFT JOIN citizenships ON citizenships.personId = persons.id " +
|
||||
"GROUP BY persons.id")
|
||||
let person = persons.first!
|
||||
(person.name, person.citizenshipsCount)
|
||||
|
||||
Reference in new issue
Block a user