Re: Coalesce 2 Arrays

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Alex Magnum <magnum11200(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Coalesce 2 Arrays
Date: 2019-06-24 21:33:24
Message-ID: 163793B6-8981-4618-9770-0AFD4D499728@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jun 24, 2019, at 2:31 PM, Alex Magnum <magnum11200(at)gmail(dot)com> wrote:
>
> Hi,
> I have two arrays which I need to combine based on the individual values;
> i could do a coalesce for each field but was wondering if there is an easier way
>
> array_a{a, null,c, d,null,f,null} primary
> array_b{null,2 ,null,4,5 ,6,null} secondary
>
> result {a, 2, c, d,5, f,null)
>
> Any advice would be appreciated
>
Are the inputs always of fixed dimensions eg. 1 by 7?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Gauthier 2019-06-24 22:25:22 Need a DB layout gui
Previous Message Alex Magnum 2019-06-24 20:31:40 Coalesce 2 Arrays