mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Make the GROUP BY clause work even if there are no aggregate functions. (CVS 859)
FossilOrigin-Name: b68792315883eed8523f5e11856ec8378dc972c1
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
# focus of this file is testing UNION, INTERSECT and EXCEPT operators
|
||||
# in SELECT statements.
|
||||
#
|
||||
# $Id: select4.test,v 1.12 2002/06/22 02:33:39 drh Exp $
|
||||
# $Id: select4.test,v 1.13 2003/02/02 12:41:27 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -467,5 +467,29 @@ do_test select4-7.4 {
|
||||
}
|
||||
} {n 1 log 0 n 2 log 1}
|
||||
|
||||
# Make sure DISTINCT works appropriately on TEXT and NUMERIC columns.
|
||||
#
|
||||
do_test select4-8.1 {
|
||||
execsql {
|
||||
BEGIN;
|
||||
CREATE TABLE t3(a text, b float, c text);
|
||||
INSERT INTO t3 VALUES(1, 1.1, '1.1');
|
||||
INSERT INTO t3 VALUES(2, 1.10, '1.10');
|
||||
INSERT INTO t3 VALUES(3, 1.10, '1.1');
|
||||
INSERT INTO t3 VALUES(4, 1.1, '1.10');
|
||||
INSERT INTO t3 VALUES(5, 1.2, '1.2');
|
||||
INSERT INTO t3 VALUES(6, 1.3, '1.3');
|
||||
COMMIT;
|
||||
}
|
||||
execsql {
|
||||
SELECT DISTINCT b FROM t3 ORDER BY c;
|
||||
}
|
||||
} {1.1 1.2 1.3}
|
||||
do_test select4-8.2 {
|
||||
execsql {
|
||||
SELECT DISTINCT c FROM t3 ORDER BY c;
|
||||
}
|
||||
} {1.1 1.10 1.2 1.3}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user