Received: from chemquick.com (root@[202.170.29.67]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA26122 for ; Fri, 11 Jun 1999 14:33:50 -0400 (EDT) (envelope-from vikrant@chemquick.com) Received: from chemquick.com ([202.170.29.126]) by chemquick.com (8.8.7/8.8.7) with ESMTP id CAA09397 for ; Sat, 12 Jun 1999 02:27:37 +0800 Message-ID: <37615940.669004B1@chemquick.com> Date: Sat, 12 Jun 1999 02:45:20 +0800 From: Vikrant Rathore Reply-To: vikrant@chemquick.com Organization: NeuroNet X-Mailer: Mozilla 4.6 [en] (Win98; I) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgreSQL.org Subject: Mail for error in tuples Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dear friend, I have a table named radius with structure Table = radius +----------------------------------+----------------------------------+-------+ | Field | Type | Length| +----------------------------------+----------------------------------+-------+ | uname | char() | 256 | | logdate | date | 4 | | logtime | time | 8 | | duration | timespan | 12 | | status | char() | 20 | | nasadd | char() | 20 | | port | int4 | 4 | | bytesin | int4 | 4 | | bytesout | int4 | 4 | | packin | int4 | 4 | | packout | int4 | 4 | | misc | int4 | 4 | +----------------------------------+----------------------------------+-------+ I keep my radius log in this table. Now in this logdate and logtime are the last logout date and time for the particular user. But sometimes the logdate and logtime and duration are wrong so inorder to correct i have to do following can anyone help me how to do it. I want to select the tuples of particular user and test the first logdate and logtime with the next tuples logdate and logtime and the duration in the second tuple should not be greater than the difference of this two tuples if its greater than the difference then it needs to be set to the difference of the two logdate and logtime. I have to test it till the last tuple. So can anyone suggest me query for this job. Thanks in advance. Regards, Vicky