drh added on 2016-04-25 01:43:33:
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.
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
SELECT 98, 99
) AS w WHERE y>=20;
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