Skip to content

Commit

Permalink
Merge pull request #3745 from obacht17/patch-1
Browse files Browse the repository at this point in the history
Describe null handling in anti join
  • Loading branch information
szarnyasg authored Sep 29, 2024
2 parents c9555b3 + 699a754 commit c5d7412
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/sql/query_syntax/from.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ USING (iata);
Semi joins return rows from the left table that have at least one match in the right table.
Anti joins return rows from the left table that have _no_ matches in the right table.
When using a semi or anti join the result will never have more rows than the left hand side table.
Semi and anti joins provide the same logic as [`IN`]({% link docs/sql/expressions/in.md %}) and `NOT IN` statements, respectively.
Semi joins provide the same logic as [`IN`]({% link docs/sql/expressions/in.md %}) statements.
Anti joins provide the same logic as `NOT IN` statements, except anti joins ignore `NULL` values from the right table.

#### Semi Join Example

Expand Down Expand Up @@ -320,7 +321,7 @@ This query is equivalent with:
```sql
SELECT *
FROM city_airport
WHERE iata NOT IN (SELECT iata FROM airport_names);
WHERE iata NOT IN (SELECT iata FROM airport_names WHERE iata IS NOT NULL);
```

### Lateral Joins
Expand Down

0 comments on commit c5d7412

Please sign in to comment.