Repository navigation
Describe the UNKNOWN result of ALL and SOME or ANY - #10485
Open
Rudi Bruchez (rudi-bruchez) wants to merge 1 commit into
Open
Rudi Bruchez (rudi-bruchez) wants to merge 1 commit into
Rudi Bruchez (rudi-bruchez) wants to merge 1 commit into
Conversation
prmerger-automator
Bot
requested a review
from Umachandar Jayachandran (uc-msft)
November 10, 2026 21:27
Contributor
|
Rudi Bruchez (@rudi-bruchez) : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
Contributor
|
Learn Build status updates of commit 9aebc6e: ✅ Validation status: passed
For more details, please refer to the build report. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's wrong
The "Result value" section of the
ALLpage says: "Returns TRUE when the comparison specified is TRUE for all pairs ... Otherwise returns FALSE." TheSOME | ANYpage says the same: "otherwise, returns FALSE."When a NULL value takes part in the comparison and decides the result, both return UNKNOWN: neither the condition nor its negation is true.
1 < ALL (2, NULL)isn't FALSE, sinceNOT (1 < ALL (2, NULL))isn't TRUE either. A reader who relies on "otherwise FALSE" writesNOT (x < ALL (...))and gets no rows.Evidence
SQL Server 2025 CU10 (17.0.5035.5), Linux container, Developer edition. No database needed; default
SEToptions ofsqlcmd -I(ANSI_NULLS ON).1 < ALL (2, 3)1 < ALL (2, NULL)3 < ALL (2, NULL)1 < ALL (empty)NULL < ALL (2, 3)3 > ANY (2, NULL)1 > ANY (2, NULL)1 > ANY (2, 3)1 > ANY (empty)Observed: UNKNOWN for
1 < ALL (2, NULL),NULL < ALL (2, 3)and1 > ANY (2, NULL). Expected per the current text: FALSE.Change
In both pages, keeps the TRUE condition, gives the FALSE condition, and says that the result is otherwise UNKNOWN. The text doesn't tie UNKNOWN to NULL values:
1 = ANY (1, NULL)is TRUE, and withANSI_NULLS OFFcomparisons with NULL can be TRUE or FALSE.