help with a query

From: "Pedro Doria Meunier" <pdoria(at)netmadeira(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: help with a query
Date: 2006-11-03 20:29:16
Message-ID: 004b01c6ff86$bc254ee0$23d6bed5@oem41cbbf9e178
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all!

This is most certainly a lame question but perhaps someone is gracious
enough to lend me a hand. ;-)

I have the following setup in a table:

The first record which is to be found (ok easy enough :D) with a timestamp
meets a certain condition (ignition off)

The following record is for the event of ignition on again with a timestamp.

So the question here is: how can I compute the time difference between these
two records in a single query?

Better yet: finding all the records that meet the first condition (ignition
off) and the immediately following records as to compute the time
difference. ;-)

Thanks in advance!

Pedro Doria Meunier

(351) 91 302 49 72 - (351) 96 247 99 12

pdoria(at)netmadeira(dot)com

MSN - pdoriam(at)hotmail(dot)com

ICQ - 308-182-126

Skype: pdoriam

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anonymous 2006-11-03 20:44:04 Re: How to get joins to work
Previous Message Benjamin Weaver 2006-11-03 20:25:25 Re: explosion of tiny tables representing multiple