Browse form with dynamically built columns
Posted: Tue Apr 20, 2021 10:35 am
While trying to make my way with nuBuilder for two or three weeks now, I don't feel comfortable with building forms on some SQL requests: as long as I try to display subsets of existing columns, everything seems to work fine. But I don't really understand why I can't display more sophisticated requests including GROUP BY clause together with SUM, etc.
For instance, if I want to display the sum of all invoices by year, I could write a request like:
which works fine on phpMyAdmin, but as soon as I try to build a Browse form, with columns y and total, I get en empty table.
For instance, if I want to display the sum of all invoices by year, I could write a request like:
Code: Select all
SELECT year(date) as y, SUM(price) as total
FROM invoices GROUP BY y ORDER BY y DESC