i need some help with my mysql query . I have one table that look like :
And then i want to select with this query :
select id, class, defaut, input, round(input - defaut) test from table1
group by class, id with rollup
I want the output like :
But my query given me like that :
please for your help, thanks
You need to sum the default, input and the calculated fields to get the expected output, otherwise rollup
will simply return the value from the last record:
select id, class, sum(defaut), sum(input), sum(round(input - defaut)) test from table1
group by class, id with rollup