Merge pull request #46927 from ghiculescu/missing-associated-guide-v2

[docs] Fix incorrect SQL in Active Record Querying guide
This commit is contained in:
Petrik de Heus 2023-01-09 07:11:45 +01:00 committed by GitHub
commit b8e09fc54e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1424,7 +1424,7 @@ Produces:
```sql
SELECT customers.* FROM customers
INNER JOIN reviews ON reviews.customer_id = customers.id
WHERE reviews.customer_id IS NOT NULL
WHERE reviews.id IS NOT NULL
```
Which means "return all customers that have made at least one review".
@ -1440,7 +1440,7 @@ Produces:
```sql
SELECT customers.* FROM customers
LEFT OUTER JOIN reviews ON reviews.customer_id = customers.id
WHERE reviews.customer_id IS NULL
WHERE reviews.id IS NULL
```
Which means "return all customers that have not made any reviews".