...SUM(COALESCE(col1, 0)), ...

On 25 June 2014 08:01, Krishnan Narayanan <krishnan.sm...@gmail.com> wrote:

> Try coalesce
>
>
> On Tue, Jun 24, 2014 at 2:49 PM, sumit ghosh <sumi...@yahoo.com> wrote:
>
>> Did you try sum(col1), sum(col2) ...   group by id
>>
>>
>>   On Tuesday, 24 June 2014 1:23 PM, usha hive <ushah...@gmail.com> 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
>>
>>
>>
>


-- 
André Araújo
Big Data Consultant/Solutions Architect
The Pythian Group - Australia - www.pythian.com

Office (calls from within Australia): 1300 366 021 x1270
Office (international): +61 2 8016 7000  x270 *OR* +1 613 565 8696   x1270
Mobile: +61 410 323 559
Fax: +61 2 9805 0544
IM: pythianaraujo @ AIM/MSN/Y! or ara...@pythian.com @ GTalk

“Success is not about standing at the top, it's the steps you leave behind.”
— Iker Pou (rock climber)

-- 


--



Reply via email to