eneral-ow...@postgresql.org
> ] *On
> Behalf Of *David G. Johnston
> *Sent:* Thursday, 14 July, 2016 08:23
> *To:* Nick Babadzhanian
> *Cc:* Tim Smith; pgsql-general
> *Subject:* Re: [GENERAL] Merging timeseries in postgres
>
>
>
> On Thu, Jul 14, 2016 at 8:18 AM, Nick B
From: pgsql-general-ow...@postgresql.org
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of David G. Johnston
Sent: Thursday, 14 July, 2016 08:23
To: Nick Babadzhanian
Cc: Tim Smith; pgsql-general
Subject: Re: [GENERAL] Merging timeseries in postgres
On Thu, Jul 14, 2016 at 8:18 AM, Nick
On Thu, Jul 14, 2016 at 8:18 AM, Nick Babadzhanian wrote:
> Whats exactly is wrong with the following query?
>
> select
> dx date,
> nx,
> nx1
> from
> test t
> join test1 t1 on t.dx=t1.dx1
> ;
>
>
Please don't top-post.
test t join test1 t1 -- th
Nevermind, I misunderstood your question.
The answer is an outer join and if you want the exact output you provided then
you can use the following clause.
coalesce(dx, dx1) as date
Is there any reason why these are two different tables? I'd consider changing
data structure.
- Original Mes
Whats exactly is wrong with the following query?
select
dx date,
nx,
nx1
from
test t
join test1 t1 on t.dx=t1.dx1
;
- Original Message -
From: "Tim Smith"
To: "pgsql-general"
Sent: Thursday, July 14, 2016 2:56:19 PM
Subject: [GENERAL] Me
On Thu, Jul 14, 2016 at 7:56 AM, Tim Smith
wrote:
>
>
2003-01-03 (null) 0.003
Where did the "0.003" come from?
The result you are looking for works if you full outer join on dx1 - at
least for the sample data.
David J.