In LO Base Version 24.2.2. a SQL query containing a GROUP BY doesn't work

The following query doesn’t work

https://ask.libreoffice.org/uploads/short-url/yGgUB9J927bHiYfVxjaqSvXGxRx.odb is a demo database document with embedded Firebird.
The following query works perfectly well:

SELECT "Categories"."N" "Product", "Persons"."N" "Person", 
MIN( "Data"."D" ) "From", 
MAX( "Data"."D" ) "Until", 
SUM( "Data"."V" ) "Total", 
AVG( "Data"."V" ) "Average" 
FROM "Data", "Categories", "Persons" 
WHERE "Data"."CID" = "Categories"."ID" AND "Data"."PID" = "Persons"."ID" 
GROUP BY "Categories"."N", "Persons"."N"

Every column that is not aggregated by a function needs to be written into the GROUP BY clause, so every value in each column represents either a calculation result or a group name.

1 Like