Skip to content

Update SUM function syntax and OVER clause details - #10391

Open
Gabriel Donizeti Candido (donican) wants to merge 2 commits into
MicrosoftDocs:livefrom
donican:donican-patch-1
Open

Update SUM function syntax and OVER clause details#10391
Gabriel Donizeti Candido (donican) wants to merge 2 commits into
MicrosoftDocs:livefrom
donican:donican-patch-1

Conversation

@donican

Copy link
Copy Markdown
Contributor

This article doesn't mention that the OVER clause can include the ROWS or RANGE clause. I believe this is particularly important because when the ORDER BY clause is specified, ROWS or RANGE assumes its default value, which can then be explicitly changed by the user. My suggested change clarifies this point.

Added row_or_range_clause to the SUM function syntax and updated the OVER clause description to include its default behavior.
@prmerger-automator

Copy link
Copy Markdown
Contributor

Gabriel Donizeti Candido (@donican) : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@prmerger-automator

Copy link
Copy Markdown
Contributor

Gabriel Donizeti Candido (@donican) : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 9024494:

✅ Validation status: passed

File Status Preview URL Details
docs/t-sql/functions/sum-transact-sql.md ✅Succeeded

For more details, please refer to the build report.

Clarified the requirements for order_by_clause and row_or_range_clause in the OVER clause section.
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 6dd7423:

✅ Validation status: passed

File Status Preview URL Details
docs/t-sql/functions/sum-transact-sql.md ✅Succeeded

For more details, please refer to the build report.

@v-regandowner

Copy link
Copy Markdown
Contributor

Randolph West MSFT (@rwestMSFT) - Can you review the proposed changes?

IMPORTANT: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Qualify the new syntax for platforms that do not support window frames.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates SUM (Transact-SQL) documentation with ROWS/RANGE window-frame syntax and default behavior.

Changes:

  • Adds optional window-frame syntax to analytic SUM.
  • Documents ORDER BY requirements and default RANGE behavior.
File summaries
File Summary
docs/t-sql/functions/sum-transact-sql.md Documents ROWS/RANGE support and window-frame defaults; platform-specific syntax qualification remains needed for APS/PDW.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


-- Analytic Function Syntax
SUM ( [ ALL ] expression) OVER ( [ partition_by_clause ] [ order_by_clause ] )
SUM ( [ ALL ] expression) OVER ( [ partition_by_clause ] [ order_by_clause ] [row_or_range_clause] )
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.

4 participants