PRODUCT
aggregation
What changes
- Input
- the argument expression over each group's rows (COUNT(*) reads no column)
- Output or change
- one value per group (or one for the whole input when there is no GROUP BY)
- Return type
- Returns the product of all expression values in the most precise expression data type. Expression result Return type tinyint int smallint int int int bigint bigint decimal category (p, s) If s is 0, d
Syntax at a glance
PRODUCT ( [ ALL | DISTINCT ] expression )
Work example
Multiply a grouped set of factors when the business calculation is defined as a product.
Check scale and overflow across the full group and confirm SQL Server 2025 target support.
Check your work PRODUCT is available in SQL Server 2025 and accumulated values can overflow.
Open Microsoft Learn for full syntax, permissions, and details for your version.