Deberá escribir una segunda consulta que utilice GROUP BY order_main_id.
Algo como:
SELECT sum(S41+...) FROM yourTable GROUP BY orderMainId
K
Deberá escribir una segunda consulta que utilice GROUP BY order_main_id.
Algo como:
SELECT sum(S41+...) FROM yourTable GROUP BY orderMainId
K