mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Allow a HAVING clause on any aggregate query, even if there is no GROUP BY
clause. This brings SQLite into closer agreement with PostgreSQL and fixes the concern raised by [forum:/forumpost/1a7fea4651|forum post 1a7fea4651]. FossilOrigin-Name: 9322a7c21f1c22ba00e9b889223e89bc1591db6e561ce05091e905e98c1bf2b3
This commit is contained in:
@ -126,9 +126,12 @@ do_test count-2.7 {
|
||||
do_test count-2.8 {
|
||||
uses_op_count {SELECT count(*) FROM t2 WHERE a IS NOT NULL}
|
||||
} {0}
|
||||
do_test count-2.9 {
|
||||
catchsql {SELECT count(*) FROM t2 HAVING count(*)>1}
|
||||
} {1 {a GROUP BY clause is required before HAVING}}
|
||||
do_execsql_test count-2.9a {
|
||||
SELECT count(*) FROM t2 HAVING count(*)>1;
|
||||
} {}
|
||||
do_execsql_test count-2.9b {
|
||||
SELECT count(*) FROM t2 HAVING count(*)<10;
|
||||
} {0}
|
||||
do_test count-2.10 {
|
||||
uses_op_count {SELECT count(*) FROM (SELECT 1)}
|
||||
} {0}
|
||||
|
Reference in New Issue
Block a user