Combine/trim records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Title: Combine/trim records
I have a table of log entries (each record represents 15 minutes).  I'd like
to combine adjacent entries when the project id (pid) is the same.  Any
suggestions on how to combine/trim these records with Postgres? Or any other non PG solution?

Before:
LogID   Date        StartTime   EndTime     Duration    PID     Description
10001   2004-01-16  08:00:00    08:15:00    0.25             1       foo
10002   2004-01-16  08:15:00    08:30:00    0.25             1       bar

After:
LogID   Date        StartTime   EndTime     Duration    PID     Description
10001   2004-01-16  08:00:00    08:30:00    0.5               1       foo bar

Thank you in advance...

--
Michael Stoyanovich
Strategy Network Inc.
mstoyanovich@xxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux