I am trying to somehow group a report based on a drop-down list of parameters that is pre-defined. I want to be able to subtotal the Total Hours or Total Pay of my report b
Group by
is simple really.
You have to list in group by
every field that is included in the select statement and not fed to an aggregate function.
Which is why you can't have a variable group by
with a fixed list of columns in select
. (Well, you can in mysql, but it effectively applies virtual any()
aggregate to them.)