From: | Tim Smith <randomdev4+postgres(at)gmail(dot)com> |
---|---|
To: | Begin Daniel <jfd553(at)hotmail(dot)com> |
Cc: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Nick Babadzhanian <nb(at)cobra(dot)ru>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Merging timeseries in postgres |
Date: | 2016-07-15 14:13:19 |
Message-ID: | CA+HuS5H16WaCyYaPEwr4LJJykJE6ePHsTh52DrnKzEA45Js-dA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Thanks for the replies guys. In the end I found an example lurking in the
depths of the Internet that used a CTE and a join to that which seemed to
have the desired effect
On Thursday, 14 July 2016, Begin Daniel <jfd553(at)hotmail(dot)com> wrote:
> *From:* pgsql-general-owner(at)postgresql(dot)org
> <javascript:_e(%7B%7D,'cvml','pgsql-general-owner(at)postgresql(dot)org');>
> [mailto:pgsql-general-owner(at)postgresql(dot)org
> <javascript:_e(%7B%7D,'cvml','pgsql-general-owner(at)postgresql(dot)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 Babadzhanian <nb(at)cobra(dot)ru
> <javascript:_e(%7B%7D,'cvml','nb(at)cobra(dot)ru');>> 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 -- this is the default inner join, your query returns
> no records for the given data.
>
>
>
> David J.
>
>
>
> Look at the above documentation (7.2.1.1) on full join
>
> https://www.postgresql.org/docs/9.3/static/queries-table-expressions.html
>
>
>
> select coalesce(dx,dx1)as dt, n, nx1
>
> from test full join test1 on dx=dx1;
>
>
>
> Daniel
>
From | Date | Subject | |
---|---|---|---|
Next Message | Melvin Davidson | 2016-07-15 14:13:25 | Re: migrating data from an old postgres version |
Previous Message | Willy-Bas Loos | 2016-07-15 14:12:38 | Re: migrating data from an old postgres version |