Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Aggregate Multiple Columns

Copy link to this message
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
Best regards,

On Thu, Aug 16, 2012 at 4:28 PM, <[EMAIL PROTECTED]> 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****