diff --git a/README.md b/README.md index 3f83564..ade4083 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ which generates this SQL: SELECT P1.*, Follow.*, P2.* FROM Person AS P1 INNER JOIN Follow ON P1.id = Follow.follower -INNER JOIN P2 ON P2.id = Follow.followed +INNER JOIN Person AS P2 ON P2.id = Follow.followed ``` Note carefully that the order of the ON clauses is reversed! You're required to write your `on`s in reverse order because that helps composability (see the documentation of `on` for more details). diff --git a/src/Database/Esqueleto.hs b/src/Database/Esqueleto.hs index 84261fa..f33c882 100644 --- a/src/Database/Esqueleto.hs +++ b/src/Database/Esqueleto.hs @@ -311,7 +311,7 @@ import qualified Database.Persist -- SELECT P1.*, Follow.*, P2.* -- FROM Person AS P1 -- INNER JOIN Follow ON P1.id = Follow.follower --- INNER JOIN P2 ON P2.id = Follow.followed +-- INNER JOIN Person AS P2 ON P2.id = Follow.followed -- @ -- -- In @esqueleto@, we may write the same query above as: