You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns the PRODUCT of all the values, or only the DISTINCT values, in the expression. Use with numeric columns only. Null values are ignored.
34
+
The `PRODUCT` function returns the product of all the values, or only the `DISTINCT` values, in an expression. Use with numeric columns only. Null values are ignored.
PRODUCT ( [ ALL ] expression) OVER ( [ partition_by_clause ] [ order_by_clause ] )
50
50
```
51
51
52
52
## Arguments
53
53
54
-
#### *ALL*
54
+
#### ALL
55
55
56
-
Applies the aggregate function to all values. ALL is the default.
56
+
Applies the aggregate function to all values. `ALL` is the default.
57
57
58
-
#### *DISTINCT*
58
+
#### DISTINCT
59
59
60
-
Specifies that PRODUCT returns the PRODUCT of unique values.
60
+
Specifies that `PRODUCT` returns the product of unique values.
61
61
62
62
#### *expression*
63
63
@@ -81,12 +81,14 @@ Returns the product of all *expression* values in the most precise *expression*
81
81
|**smallint**|**int**|
82
82
|**int**|**int**|
83
83
|**bigint**|**bigint**|
84
-
|**decimal** category (p, s) | If (s == 0):**decimal(38, 0)** Else:**decimal(38, 6)**|
84
+
|**decimal** category (*p*, *s*) | If *s* is `0`,**decimal(38, 0)**, otherwise**decimal(38, 6)**|
85
85
|**money** and **smallmoney** category |**money**|
86
86
|**float** and **real** category |**float**|
87
87
88
88
## Remarks
89
89
90
+
Support for `PRODUCT` in [!INCLUDE [ssazuremi-md](../../includes/ssazuremi-md.md)] is limited to [!INCLUDE [ssazure-sqlmi-autd](../../includes/ssazure-sqlmi-autd.md)].
91
+
90
92
`PRODUCT` is a deterministic function when used without the `OVER` and `ORDER BY` clauses. It's nondeterministic when specified with the `OVER` and `ORDER BY` clauses. For more information, see [Deterministic and nondeterministic functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md).
91
93
92
94
## Examples
@@ -95,33 +97,35 @@ Returns the product of all *expression* values in the most precise *expression*
95
97
96
98
### A. Multiply rows together
97
99
98
-
The following examples show using the PRODUCT function
100
+
The following example uses the `PRODUCT` function:
The following example uses the PRODUCT function with the OVER clause to provide a rate of return on hypothetical financial instruments. The data is partitioned by `finInstrument`.
128
+
The following example uses the `PRODUCT` function with the `OVER` clause to provide a rate of return on hypothetical financial instruments. The data is partitioned by `finInstrument`.
0 commit comments