Fixed
Details
Details
Assignee
Pothys - MitrahSoft
Pothys - MitrahSoftReporter
Brad Wood
Brad WoodPriority
Labels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Affects versions
Created 18 July 2024 at 19:06
Updated 12 August 2024 at 06:02
Resolved 12 August 2024 at 06:02
Adding ORDER BY to aggregate QOQ select without GROUP BY where the ordered column is not part of the select list causes the result to group on the additional column instead of getting a single row back.
Ex:
testQuery = queryNew("amount, relatedData, unrelateddata","integer, varchar, integer"); testQuery.addRow({amount: 1, relatedData: "a", unrelateddata: 1}); testQuery.addRow({amount: 2, relatedData: "a", unrelateddata: 2}); testQuery.addRow({amount: 3, relatedData: "a", unrelateddata: 3}); // should produce a single row queryExecute(" select sum(amount) from testQuery where 1=1 order by unrelatedData ", {}, {dbtype="query"});
See: https://dev.lucee.org/t/possible-bug-qoq-aggregate-issue-when-using-where-and-order-by/14095/3