(text/x-fossil-wiki)
The following query works and gives the correct answer for SQLite version 3.8.10
but fails to compile with a "misuse of aggregate" error for 3.8.11.
<blockquote><verbatim>
CREATE TABLE t1(a int, b int);
INSERT INTO t1 VALUES(1,2),(1,18),(2,19);
SELECT x, y FROM (
SELECT a AS x, sum(b) AS y FROM t1 GROUP BY a
UNION
SELECT 98, 99
) AS w WHERE y>=20;
</verbatim></blockquote>
The problem seems to have been introduced by check-in [6df18e949d36] on [2015-06-02].
The problem was reported on the sqlite-users mailing list by
Jean-Luc Hainaut.
|