From 2a2c5a772f93e1dea6fa77405c62cd497977307b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 16 Apr 2018 14:05:04 +0200 Subject: [PATCH] Cleanup --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b5543b7f..6e45f1558 100644 --- a/README.md +++ b/README.md @@ -4898,7 +4898,20 @@ To acknowledge that both Player and Team records may customize their selection o `Player.selectionSQL()` will output `players.*`, unless Player defines a [customized selection](#columns-selected-by-a-request). -> :point_up: **Note**: you may also provide an alias: `SELECT \(Players.selectionSQL(alias: "p")) FROM players p ...` +> :point_up: **Note**: you may also use SQL table aliases: +> +> ```swift +> let sql = """ +> SELECT +> \(Player.selectionSQL(alias: "p")), +> \(Team.selectionSQL(alias: "t")), +> MAX(r.score) AS maxScore +> FROM players p +> LEFT JOIN teams t ON ... +> LEFT JOIN rounds r ON ... +> GROUP BY ... +> """ +> ``` Now is the time to build adapters (taking in account the customized selection of both players and teams). We use the `splittingRowAdapters` global function, which builds row adapters of desired widths: