Files
sqlite/test/window4.test
T
dan 6bc5c9e788 Add implementation of window function ntile().
FossilOrigin-Name: 3f093f608c6cc193aac77e7eafa8006c27a7776682d9d7b6e743710dff41ae42
2018-06-04 18:55:11 +00:00

106 lines
3.3 KiB
Plaintext

# 2018 June 04
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.
#
####################################################
# DO NOT EDIT! THIS FILE IS AUTOMATICALLY GENERATED!
####################################################
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix window4
do_execsql_test 1.0 {
DROP TABLE IF EXISTS t3;
CREATE TABLE t3(a TEXT PRIMARY KEY);
INSERT INTO t3 VALUES('a'), ('b'), ('c'), ('d'), ('e');
INSERT INTO t3 VALUES('f'), ('g'), ('h'), ('i'), ('j');
} {}
do_execsql_test 1.1 {
SELECT a, ntile(1) OVER (ORDER BY a) FROM t3
} {a 1 b 1 c 1 d 1 e 1 f 1 g 1 h 1 i 1 j 1}
do_execsql_test 1.2 {
SELECT a, ntile(2) OVER (ORDER BY a) FROM t3
} {a 1 b 1 c 1 d 1 e 1 f 2 g 2 h 2 i 2 j 2}
do_execsql_test 1.3 {
SELECT a, ntile(3) OVER (ORDER BY a) FROM t3
} {a 1 b 1 c 1 d 1 e 2 f 2 g 2 h 3 i 3 j 3}
do_execsql_test 1.4 {
SELECT a, ntile(4) OVER (ORDER BY a) FROM t3
} {a 1 b 1 c 1 d 2 e 2 f 2 g 3 h 3 i 4 j 4}
do_execsql_test 1.5 {
SELECT a, ntile(5) OVER (ORDER BY a) FROM t3
} {a 1 b 1 c 2 d 2 e 3 f 3 g 4 h 4 i 5 j 5}
do_execsql_test 1.6 {
SELECT a, ntile(6) OVER (ORDER BY a) FROM t3
} {a 1 b 1 c 2 d 2 e 3 f 3 g 4 h 4 i 5 j 6}
do_execsql_test 1.7 {
SELECT a, ntile(7) OVER (ORDER BY a) FROM t3
} {a 1 b 1 c 2 d 2 e 3 f 3 g 4 h 5 i 6 j 7}
do_execsql_test 1.8 {
SELECT a, ntile(8) OVER (ORDER BY a) FROM t3
} {a 1 b 1 c 2 d 2 e 3 f 4 g 5 h 6 i 7 j 8}
do_execsql_test 1.9 {
SELECT a, ntile(9) OVER (ORDER BY a) FROM t3
} {a 1 b 1 c 2 d 3 e 4 f 5 g 6 h 7 i 8 j 9}
do_execsql_test 1.10 {
SELECT a, ntile(10) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
do_execsql_test 1.11 {
SELECT a, ntile(11) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
do_execsql_test 1.12 {
SELECT a, ntile(12) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
do_execsql_test 1.13 {
SELECT a, ntile(13) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
do_execsql_test 1.14 {
SELECT a, ntile(14) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
do_execsql_test 1.15 {
SELECT a, ntile(15) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
do_execsql_test 1.16 {
SELECT a, ntile(16) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
do_execsql_test 1.17 {
SELECT a, ntile(17) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
do_execsql_test 1.18 {
SELECT a, ntile(18) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
do_execsql_test 1.19 {
SELECT a, ntile(19) OVER (ORDER BY a) FROM t3
} {a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10}
finish_test