Hi All,
Normal table out put;
x | y
----------+----------
12:40:23 | 12:40:23
14:40:25 |
14:45:00 |
14:49:55 |
| 14:00:00
(5 rows)
Full outer join with interpolation:
SELECT * FROM t FULL OUTER JOIN t1 ON t.x INTERPOLATE PREVIOUS VALUE t1.y;
x | y
----------+----------
12:40:23 | 12:40:23
12:40:23 | 14:00:00
14:40:25 | 14:00:00
14:45:00 | 14:00:00
14:49:55 | 14:00:00
(5 rows)
as per the query the y's previous values are padded with null values.
But how we got the value '14:49:55' in x.
Please explain 'X' values.
Thanks,
Malar
Interpolate query
Moderator: NorbertKrupa
Re: Interpolate query
Hello Malar,
Interpolate joins are time series joins, basically a simple extension to outer joins( Full, Left, Right)
It will look for the matches between the t.x and t1.y
If it finds one, then The records can be seen together and there will be no null pads corresponding to that value as here
But if there are no matches then we can see the previous records in the null table columns.
Basically you can think of it as sorting the columns in ascending order with matching columns
The value '14:49:55' is already in the table 't' and its a FULL OUTER JOIN. so there should be no surprises, If we see this value
Fow a deeper understanding on this, you can refer this topic
http://stackoverflow.com/questions/1707 ... te-feature
Hope this helps you
Interpolate joins are time series joins, basically a simple extension to outer joins( Full, Left, Right)
It will look for the matches between the t.x and t1.y
If it finds one, then The records can be seen together and there will be no null pads corresponding to that value as here
Code: Select all
x | y
----------+----------
12:40:23 | 12:40:23
Basically you can think of it as sorting the columns in ascending order with matching columns
The value '14:49:55' is already in the table 't' and its a FULL OUTER JOIN. so there should be no surprises, If we see this value
Fow a deeper understanding on this, you can refer this topic
http://stackoverflow.com/questions/1707 ... te-feature
Hope this helps you
-
- Newbie
- Posts: 23
- Joined: Mon Feb 04, 2013 10:54 am
Re: Interpolate query
Hi
Thank you for the reply.
In this interpolated query result
x|y
------------------------
12:40:23 | 12:40:23
12:40:23 | 14:00:00
14:40:25 | 14:00:00
14:45:00 | 14:00:00
14:49:55 | 14:00:00
in x this value is repeated one more time (12:40:23).
Thank you for the reply.
In this interpolated query result
x|y
------------------------
12:40:23 | 12:40:23
12:40:23 | 14:00:00
14:40:25 | 14:00:00
14:45:00 | 14:00:00
14:49:55 | 14:00:00
in x this value is repeated one more time (12:40:23).