Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update between-transact-sql.md #9996

Open
wants to merge 1 commit into
base: live
Choose a base branch
from

Conversation

asos-martinsmith
Copy link
Contributor

@asos-martinsmith asos-martinsmith commented Jan 25, 2025

The statement that if any part is NULL the overall expression evaluates to UNKNOWN is not correct.

Counter example

SELECT 1
WHERE NOT 2 BETWEEN NULL AND 1

Because 2 BETWEEN NULL AND 1 is equivalent to

2  >= NULL  AND 2  <= 1

or

UNKNOWN  AND FALSE

Which is FALSE

(so TRUE when negated with NOT)

The statement that if any part is `NULL` the overall expression evaluates to `UNKNOWN` is not correct.

Counter example 

```
SELECT 1
WHERE NOT 2 BETWEEN NULL AND 1
```

Because that is equivalent to 

```
2  >= NULL  AND 2  <= 1
```

or 

```
UNKNOWN  AND FALSE
```

Which is `FALSE`
Copy link
Contributor

@asos-martinsmith : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Copy link
Contributor

Learn Build status updates of commit ea36599:

✅ Validation status: passed

File Status Preview URL Details
docs/t-sql/language-elements/between-transact-sql.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants