0

I need sum column by column in MySQL.

First SUM(column_1) and show your TOTAL in final row.

Second SUM(column_2) and show your TOTAL in final row.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • 3
    Hey Rudieron, welcome to SO! Please make sure you read up the following: [How to ask a good question](https://stackoverflow.com/help/how-to-ask), providing a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) and [How do I ask and answer homework questions](https://meta.stackoverflow.com/questions/334822/how-do-i-ask-and-answer-homework-questions). – FullStackOfPancakes Dec 12 '19 at 00:59

1 Answers1

3

Use this command to perform aggregation in Mysql.

select sum(A) as TotalA, sum(B) as TotalB ,sum(C) as TotalC from mytable 

for the last line

LIMIT 1  // <--- Add

Also : I found this while looking for a better result for you. MySql sum elements of a column

Smokie
  • 124
  • 2
  • 9