SQLite

View Ticket
Login
Ticket Hash: 2f7170d73bf9abf80339187aa3677dce3dbcd5ca
Title: "misuse of aggregate" error if aggregate column from FROM subquery is used in correlated subquery
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2015-02-09 18:28:04
10.40 years ago
Created: 2015-02-09 07:51:36
10.40 years ago
Version Found In: trunk
User Comments:
dan added on 2015-02-09 07:51:36:

CREATE TABLE t1(x);
CREATE TABLE t2(y, z);
SELECT ( SELECT y FROM t2 WHERE z = cnt ) FROM ( SELECT count(*) AS cnt FROM t1 );

This is likely the same problem as reported here:

https://www.mail-archive.com/sqlite-users@sqlite.org/msg88569.html