3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 set testprefix windowE
17 proc custom {a b} { return [string compare $a $b] }
18 db collate custom custom
21 CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT COLLATE custom);
22 INSERT INTO t1 VALUES(1, 'one');
23 INSERT INTO t1 VALUES(2, 'two');
24 INSERT INTO t1 VALUES(3, 'three');
25 INSERT INTO t1 VALUES(4, 'four');
26 INSERT INTO t1 VALUES(5, 'five');
27 INSERT INTO t1 VALUES(6, 'six');
28 CREATE INDEX t1b ON t1(b);
34 1 one 2 two 3 three 4 four 5 five 6 six
38 SELECT group_concat(a,',') OVER win FROM t1
40 ORDER BY b RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
46 proc custom {a b} { return [string compare $b $a] }
49 SELECT group_concat(a,',') OVER win FROM t1
51 ORDER BY b RANGE BETWEEN 1 PRECEDING AND 2 PRECEDING
54 5 5,4 5,4,1 5,4,1,6 5,4,1,6,3 5,4,1,6,3,2