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

Switch to Threaded View
Hive, mail # user - Reg: Merging Rows


Copy link to this message
-
Re: Reg: Merging Rows
sumit ghosh 2014-06-24, 21:49
Did you try sum(col1), sum(col2) ...   group by id 
On Tuesday, 24 June 2014 1:23 PM, usha hive <[EMAIL PROTECTED]> wrote:
 
Hi,
I am trying to merge few rows in to 1 row. I am stuck. Please help me.
Example
id  col1      col2      col3        col4 
1   44       NULL    NULL    NULL
1  NULL     37       NULL     NULL
1  NULL    NULL   88        NULL
1  NULL    NULL   NULL    99

to
id  col1      col2      col3        col4 

1     44          37        88           99

Thanks,
Usha