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 #***********************************************************************
11 # This file implements regression tests for SQLite library.
13 # The focus of this file is testing that LIMIT and OFFSET work for
14 # unusual combinations SELECT statements.
16 # $Id: select8.test,v 1.1 2008/01/12 12:48:09 drh Exp $
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
22 CREATE TABLE songs(songid, artist, timesplayed);
23 INSERT INTO songs VALUES(1,'one',1);
24 INSERT INTO songs VALUES(2,'one',2);
25 INSERT INTO songs VALUES(3,'two',3);
26 INSERT INTO songs VALUES(4,'three',5);
27 INSERT INTO songs VALUES(5,'one',7);
28 INSERT INTO songs VALUES(6,'two',11);
31 SELECT DISTINCT artist,sum(timesplayed) AS total
33 GROUP BY LOWER(artist)
37 SELECT DISTINCT artist,sum(timesplayed) AS total
39 GROUP BY LOWER(artist)
42 } [lrange $result 2 3]
45 SELECT DISTINCT artist,sum(timesplayed) AS total
47 GROUP BY LOWER(artist)
50 } [lrange $result 2 5]
53 SELECT DISTINCT artist,sum(timesplayed) AS total
55 GROUP BY LOWER(artist)
58 } [lrange $result 4 end]