RudieronPraxedes
RudieronPraxedes

Reputation: 1

How to SUM Column by Column MYSQL

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.

Upvotes: 0

Views: 77

Answers (1)

Smokie
Smokie

Reputation: 124

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

Upvotes: 3

Related Questions