Received: from cyclone.stortek.com (cyclone.stortek.com [129.80.22.130]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5DIWTE48309 for ; Wed, 13 Jun 2001 14:32:29 -0400 (EDT) (envelope-from CreagRS@LOUISVILLE.STORTEK.COM) Received: from cyclone.stortek.com (localhost [127.0.0.1]) by cyclone.stortek.com (8.9.3/8.9.3) with ESMTP id MAA11649 for ; Wed, 13 Jun 2001 12:32:22 -0600 (MDT) Received: from vinson-atm6.stortek.com (root@vinson.stortek.com [129.80.40.134] (may be forged)) by cyclone.stortek.com (8.9.3/8.9.3) with ESMTP id MAA11642 for ; Wed, 13 Jun 2001 12:32:21 -0600 (MDT) Received: from lsv-bridge.stortek.com (lsv-bridge.stortek.com [129.80.5.131]) by vinson-atm6.stortek.com (8.9.3/8.9.3) with ESMTP id MAA20810 for ; Wed, 13 Jun 2001 12:32:21 -0600 (MDT) Received: by lsv-bridge.stortek.com with Internet Mail Service (5.5.2653.19) id ; Wed, 13 Jun 2001 12:32:21 -0600 Message-ID: <10FE17AD5F7ED31188CE002048406DE8514DE0@lsv-msg06.stortek.com> From: "Creager, Robert S" To: "'SQL - PGSQL'" Subject: Determine the time difference from records in a select Date: Wed, 13 Jun 2001 12:32:19 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Archive-Number: 200106/199 X-Sequence-Number: 3455 I apologize in advance, 'cause I think this was addressed a couple of months ago, but I cannot find it in the archives. I have a firewall hit database which keeps the date of the hit and the offenders IP (among other items). I would like to be able to execute a select which would show each unique IP and the time difference from the latest hit to the first hit. I can do this in scripts, but was wondering if there is a pure SQL query/queries way to accomplish this. Help? Rob Robert Creager Senior Software Engineer Client Server Library 303.673.2365 V 303.661.5379 F 888.912.4458 P StorageTek INFORMATION made POWERFUL