diff options
| author | Kevin Marsh <kevinmarsh3@gmail.com> | 2020-12-10 11:28:55 -0800 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-12-10 21:01:57 +0100 |
| commit | 45f4282149e13a2c1548a579f60d098e397a33d7 (patch) | |
| tree | c3595569a71a5363d86e805af3ff08efadd6906a /docs | |
| parent | 00a1d42bf0d83ba4b329271433eb5e3fd0f704fe (diff) | |
Refs #31792 -- Updated SQL example in Exists() docs.
Follow up to 51297a92324976a704279b567ec4f80bb92d7b60.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/expressions.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 0c6ff1e79e..51addc4812 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -633,12 +633,13 @@ On PostgreSQL, the SQL looks like: .. code-block:: sql SELECT "post"."id", "post"."published_at", EXISTS( - SELECT U0."id", U0."post_id", U0."email", U0."created_at" + SELECT (1) as "a" FROM "comment" U0 WHERE ( U0."created_at" >= YYYY-MM-DD HH:MM:SS AND - U0."post_id" = ("post"."id") + U0."post_id" = "post"."id" ) + LIMIT 1 ) AS "recent_comment" FROM "post" It's unnecessary to force ``Exists`` to refer to a single column, since the |
