X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2114153BF1 for ; Wed, 20 Apr 2005 13:17:28 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62257-10 for ; Wed, 20 Apr 2005 16:17:24 +0000 (GMT) Received: from pop.imatech.net (mx1.imatech.net [81.255.215.227]) by svr1.postgresql.org (Postfix) with ESMTP id 6756B53BE9 for ; Wed, 20 Apr 2005 13:17:21 -0300 (ADT) Received: from imatech.net (81.255.215.226) by pop.imatech.net with MERCUR Mailserver (v4.03.13 ODUtMjQzNS00ODc3) for ; Wed, 20 Apr 2005 18:16:40 +0200 Received: from [200.200.200.185] ([195.6.193.141]) by imatech.net with Microsoft SMTPSVC(6.0.3790.211); Wed, 20 Apr 2005 18:10:36 +0200 Message-ID: <42667F3C.6080303@cerene.fr> Date: Wed, 20 Apr 2005 18:11:40 +0200 From: =?ISO-8859-1?Q?St=E9phane_RIFF?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Query question Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Apr 2005 16:10:36.0750 (UTC) FILETIME=[7CF816E0:01C545C3] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.076 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/305 X-Sequence-Number: 21198 Hi , I have table that represent a switch activity like this : | date | state | | 2005-04-20 17:00:00 | 0 | | 2005-04-20 17:00:15 | 0 | | 2005-04-20 17:00:30 | 1 | | 2005-04-20 17:00:45 | 1 | | 2005-04-20 17:01:00 | 1 | | 2005-04-20 17:01:15 | 0 | | 2005-04-20 17:01:30 | 0 | | 2005-04-20 17:01:45 | 0 | I want to get the date of each states change but i not a sql expert. Can someone advices me Thanks