So i\'ve been looking at this one for a while and I can\'t seem to figure it out.
I have a mysql table with the following format and sample data:
ID, Cus
You could use a join on a subselect with the sum for customer You could use a join on a subselect with the sum for customer
select a.customer, a.error, t.num_row, t.duration
from my_table a
inner join (
select customer, count(*) as num_row, sum(duration) duration
from my_table
group by customer
) t on t.customer = a.customer