Update with last known location?

From: James David Smith <james(dot)david(dot)smith(at)gmail(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Update with last known location?
Date: 2014-01-27 13:02:05
Message-ID: CAMu32ABKpNiE3qyDe7CO-sqq=KOJpX0PmO6NEcoEcWxUXp1i=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Dear all,

I have a large table of data which has about 75,000 people's locations
per minute of the day for a 24 hour period. The columns are:

ppid (person ID)
point_time (timestamp)
the_geom (geometry point)

My problem is that some (alot) of the info from the location
(the_geom) column is missing. This column needs updating with the last
known location of the person. The attached screenshot explains a bit
better than I am managing too in writing. In the attached image,
the_geom column from 14:41 to 14:51 would be updated with the data
from the 14:40.

I'm struggling conceptually as to how to do this. Some sort of
self-join on the table I think. But how to get the right data for the
update?

Does anyone have any clever ideas?

Thanks

JDS

Attachment Content-Type Size
Selection_001.png image/png 73.6 KB

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Rohit Goyal 2014-01-27 17:05:34 Fwd: Request for error explaination || Adding a new integer in indextupleData Structure
Previous Message Sameer Kumar 2014-01-23 06:00:28 Re: archive folder maintenance