"Nested aggregate functions are not allowed" error on FB30
----------------------------------------------------------
Key: CORE-6256
URL: http://tracker.firebirdsql.org/browse/CORE-6256
Project: Firebird Core
Issue Type: Bug
Components: Engine
Affects Versions: 3.0.5
Reporter: Attila Molnár
Hi!
This works for FB25 (Dialect1), but not for FB30 (Dialect3).
SELECT
SUM(
kf.keszlet_db +
(SELECT
SUM((
CASE WHEN rt.vdb IS NULL THEN rt.db ELSE rt.vdb END -
COALESCE(rt.ktdb, 0)) *
(SELECT kv.szorzo
FROM ktfj_valtoszam(kf.ktfj_id, rt.mert_id, kf.mert_id) kv))
FROM ktrt rt)) szabad_db
FROM ktkf kf
Our workaround : extract the subselect into CTE and then FB30 accepts it.
WITH
sub AS
(SELECT
(CASE WHEN rt.vdb IS NULL THEN rt.db ELSE rt.vdb END -
COALESCE(rt.ktdb, 0)) *
(SELECT kv.szorzo
FROM ktfj_valtoszam(kf.ktfj_id, rt.mert_id, kf.mert_id) kv) db
FROM ktrt rt)
SELECT
SUM(
kf.keszlet_db +
(SELECT
SUM(db)
FROM sub)) szabad_db
FROM ktkf kf
(I can send the database on request)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel