Select latest Timestamp values with group by - Mailing list pgsql-general

From Adarsh Sharma
Subject Select latest Timestamp values with group by
Date
Msg-id 4E92E5C5.3090002@orkash.com
Whole thread Raw
Responses Re: Select latest Timestamp values with group by  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-general
Dear all,

I need to write a query to select latest rows with timestamp values.
My ID is repeated with lat lon and timestamp. I want the latest row of
each ID ( group by id ).

Snapshot of small dataset :-

"3903";"661000212";34.3000000312542;74.4666670842472;0;"2011-10-10
12:47:33.360572"
"3904";"661000212";24.816667028954;93.9500000453283;0;"2011-10-10
12:47:33.360572"
"3905";"661000212";24.816667028954;93.9500000453283;0;"2011-10-20
12:47:33.360572"
"3906";"661000213";24.816667028954;93.9500000453283;0;"2011-10-10
12:47:33.360572"
"3907";"661000212";24.816667028954;93.9500000453283;0;"2011-10-10
12:47:33.360572"
"3908";"661000212";24.816667028954;93.9500000453283;0;"2011-10-10
12:47:33.360572"
"3909";"661000212";25.1166670062712;94.3666669968243;0;"2011-10-10
12:47:33.360572"
"3910";"661000213";26.8491101532852;92.8058205131302;0;"2011-10-10
12:47:33.360572"
"3911";"661000212";26.8491101532852;92.8058205131302;0;"2011-10-14
12:47:33.360572"


Can anyone let me know the query for that.


Thanks

pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Permission for pg_shadow.
Next
From: Craig Ringer
Date:
Subject: Re: Postgres 9.01, Amazon EC2/EBS, XFS, JDBC and lost connections