From 3f619478f796eddbba6e39502fe941b285dd97b1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:00:34 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- mysql-test/main/win_percent_cume.test | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 mysql-test/main/win_percent_cume.test (limited to 'mysql-test/main/win_percent_cume.test') diff --git a/mysql-test/main/win_percent_cume.test b/mysql-test/main/win_percent_cume.test new file mode 100644 index 00000000..05ace95d --- /dev/null +++ b/mysql-test/main/win_percent_cume.test @@ -0,0 +1,36 @@ +create table t1 ( + pk int primary key, + a int, + b int +); + + +insert into t1 values +( 1 , 0, 10), +( 2 , 0, 10), +( 3 , 1, 10), +( 4 , 1, 10), +( 8 , 2, 10), +( 5 , 2, 20), +( 6 , 2, 20), +( 7 , 2, 20), +( 9 , 4, 20), +(10 , 4, 20); + +select a, + percent_rank() over (order by a), + cume_dist() over (order by a) +from t1; + +select pk, + percent_rank() over (order by pk), + cume_dist() over (order by pk) +from t1 order by pk; + +select a, + percent_rank() over (partition by a order by a), + cume_dist() over (partition by a order by a) +from t1; + +drop table t1; + -- cgit v1.2.3