Thanks Jan,

I was looking for the first one, summing the values from two columns into one 
number.
I did it as sum(col1) + sum(col2), but your solution is more elegant ☺

Regards,
Richin

From: ext Jan Dolinár [mailto:dolik....@gmail.com]
Sent: Thursday, August 16, 2012 12:07 PM
To: user@hive.apache.org
Subject: Re: Aggregate Multiple Columns

Hi Richin,

Do you mean summing the values from two columns into one number, or calculating 
sum of both columns into two sums in one query? Both is possible, the first can 
be done simply as SUM(col1 + col2), the second can be accomplished with two 
sums: sum(col1), sum(col2). Does that answer your question?


Best regards,
Jan
On Thu, Aug 16, 2012 at 4:28 PM, 
<richin.j...@nokia.com<mailto:richin.j...@nokia.com>> wrote:
Hello,

Is there a way to aggregate multiple columns in Hive?
I can do it in two separate queries but is there something similar to 
sum(col1,col2)?

Thanks,
Richin

Reply via email to