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
Copy file name to clipboardExpand all lines: docs/t-sql/functions/approx-percentile-cont-transact-sql.md
+9-19Lines changed: 9 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,38 +57,28 @@ float(53)
57
57
## Remarks
58
58
59
59
Any nulls in the data set are ignored.
60
+
61
+
Approximate percentile functions use KLL sketch. The sketch is built by reading the stream of data. Due to the algorithm used, this function requires less memory than its non-approximate counterpart ([PERCENTILE_CONT](/sql/t-sql/functions/percentile-cont-transact-sql)).
60
62
61
-
Approximate percentile functions use KLL sketch. The sketch is built by
62
-
reading the stream of data. Due to the algorithm used, this function
63
-
requires less memory than its non-approximate counterpart
This function provides rank-based error guarantees not value based. The
67
-
function implementation guarantees up to a 1.33% error.
63
+
This function provides rank-based error guarantees not value based. The function implementation guarantees up to a 1.33% error.
68
64
69
65
## Known Behaviors
70
66
71
67
- If the trace flag is not enabled below error message would be raised
72
68
73
-
Msg 195, Level 15, State 22, Line 1 </br>
74
-
'approx_percentile_cont' is not a recognized built-in function name
69
+
Msg 195, Level 15, State 22, Line 1 </br>
70
+
'approx_percentile_cont' is not a recognized built-in function name
75
71
76
-
- The output of the function may not be the same in all executions. The algorithm used for these
77
-
functions is [KLL sketch](https://arxiv.org/pdf/1603.05346v2.pdf) which is a randomized algorithm. Every time the sketch is built, random
78
-
values are picked. This functions provide rank-based error guarantees not value based.
79
-
- The
80
-
function implementation guarantees up to a 1.33% error bounds within a 99% confidence.
72
+
- The output of the function may not be the same in all executions. The algorithm used for these functions is [KLL sketch](https://arxiv.org/pdf/1603.05346v2.pdf) which is a randomized algorithm. Every time the sketch is built, random values are picked. These functions provide rank-based error guarantees not value based.
73
+
- The function implementation guarantees up to a 1.33% error bounds within a 99% confidence.
81
74
82
75
## Compatibility Support
83
76
84
-
Under compatibility level 110 and higher, WITHIN GROUP is a reserved
85
-
keyword. For more information, see [ALTER DATABASE Compatibility Level
Under compatibility level 110 and higher, WITHIN GROUP is a reserved keyword. For more information, see [ALTER DATABASE Compatibility Level (Transact-SQL).](/sql/t-sql/statements/alter-database-transact-sql-compatibility-level)
87
78
88
79
## Examples
89
80
90
-
The following example creates a table, populates it, and executes a
91
-
sample query.
81
+
The following example creates a table, populates it, and executes a sample query.
Copy file name to clipboardExpand all lines: docs/t-sql/functions/approx-percentile-disc-transact-sql.md
+7-19Lines changed: 7 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,17 +39,11 @@ WITHIN GROUP (ORDER BY order_by_expression [ASC|DESC]
39
39
40
40
*numeric_literal*
41
41
42
-
The percentile to compute. The value must range between 0.0 and 1.0. to
43
-
calculate 10th percentile, the value passed would be 0.10.
42
+
The percentile to compute. The value must range between 0.0 and 1.0. to calculate 10th percentile, the value passed would be 0.10.
44
43
45
44
*order_by_expression*
46
45
47
-
Specifies a list of values to sort and compute the percentile over. The
48
-
default sort order is ascending (ASC). Only numeric data types are
49
-
allowed. The expression must evaluate to an exact or approximate numeric
50
-
type, with no other data types allowed. Exact numeric types are int,
51
-
bigint, smallint, tinyint, numeric, bit, decimal, smallmoney, and money.
52
-
Approximate numeric types are float and real.
46
+
Specifies a list of values to sort and compute the percentile over. The default sort order is ascending (ASC). Only numeric data types are allowed. The expression must evaluate to an exact or approximate numeric type, with no other data types allowed. Exact numeric types are int, bigint, smallint, tinyint, numeric, bit, decimal, smallmoney, and money. Approximate numeric types are float and real.
53
47
54
48
## Return types
55
49
@@ -59,12 +53,9 @@ The return type is determined by the *order_by_expression* type.
59
53
60
54
Any nulls in the data set are ignored.
61
55
62
-
Approximate percentile functions use KLL sketch. The sketch is built by
63
-
reading the stream of data.
56
+
Approximate percentile functions use KLL sketch. The sketch is built by reading the stream of data.
64
57
65
-
This function provides rank-based error guarantees not value based. The
66
-
function implementation guarantees up to a 1.33% error rate within a 99%
67
-
probability.
58
+
This function provides rank-based error guarantees not value based. The function implementation guarantees up to a 1.33% error rate within a 99% probability.
68
59
69
60
## Known Behaviors
70
61
@@ -80,20 +71,17 @@ probability.
80
71
81
72
To workaround above error, use cast/convert to change decimal or numeric data type to float data type or use continuous approximate percentile function.
82
73
83
-
- The output of the functions may not be the same in all executions. The algorithm used for these functions is [KLL sketch](https://arxiv.org/pdf/1603.05346v2.pdf) which is a randomized algorithm. Every time the sketch is built, random values are picked. This functions provide rank-based error guarantees not value based.
74
+
- The output of the functions may not be the same in all executions. The algorithm used for these functions is [KLL sketch](https://arxiv.org/pdf/1603.05346v2.pdf) which is a randomized algorithm. Every time the sketch is built, random values are picked. These functions provide rank-based error guarantees not value based.
84
75
85
76
- The function implementation guarantees up to a 1.33% error bounds within a 99% confidence.
86
77
87
78
## Compatibility Support
88
79
89
-
Under compatibility level 110 and higher, WITHIN GROUP is a reserved
90
-
keyword. For more information, see [ALTER DATABASE Compatibility Level
Under compatibility level 110 and higher, WITHIN GROUP is a reserved keyword. For more information, see [ALTER DATABASE Compatibility Level (Transact-SQL).](/sql/t-sql/statements/alter-database-transact-sql-compatibility-level).
92
81
93
82
## Examples
94
83
95
-
The following example creates a table, populates it and runs the sample
96
-
query.
84
+
The following example creates a table, populates it and runs the sample query.
0 commit comments