The results I want
Please Help Me, Thanks for attention.
You can use group by with rollup
along with ifnull
:
select ifnull(customer, 'Total') customer, sum(qty)
from yourtable
group by customer
with rollup
You may do it this way (syntax as per SQL Server):
select Customer,sum(Qty)
from whatevertable
group by Customer
Union
select 'Total' as Customer,sum(Qty)
from whatevertable
In Pentaho Kettle (PDI): Drag two hops from a step, and make sure you choose 'Copy'. One of the output streams can be used to aggregate on Customer level, the other one can be used to get a Total aggregation. Then use an 'Append streams' step.