Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by hub.org (8.10.1/8.10.1) with ESMTP id e9CHfUr59357 for ; Thu, 12 Oct 2000 13:41:30 -0400 (EDT) Received: from ipinc.com (jliang.ipinc.com [199.245.188.130]) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id KAA89542; Thu, 12 Oct 2000 10:41:15 -0700 (PDT) (envelope-from jliang@ipinc.com) Message-ID: <39E5F694.E39A63C5@ipinc.com> Date: Thu, 12 Oct 2000 10:36:20 -0700 From: Jie Liang Organization: ipinc.com X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 3.4-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: josh@agliodbs.com CC: sqllist Subject: Re: if else query help References: <5.0.0.25.2.20001012094914.081abeb0@pop.mindspring.com> <6812102772.20001012165653@thefreecat.org> <39E5DA4B.DCE967D6@agliodbs.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200010/117 X-Sequence-Number: 1779 Hey, there, This is very interesting. I have similar problem: I want drop some junky table in my database, how can I detect a table when last time it is used. I try to say that I want to know how long this table has NOT been used at all. I don't which system table holds this statistics. Josh Berkus wrote: > Brian, Jean-Christophe, > > >Someone corrects me if I'm wrong, I come from the Oracle world... > > > > Dates (or I should say TimeStamps) are stored as floating point values > > : the integer part is the number of days since a certain date > > (epoch or 01/01/1970 on unix-based databases) and the fractionnal part is the > > portion of the day (although I don't know --yet-- how to convert > > date2-date1 to an integer, trunc does not work). > > You're doing this the hard way. One of Postgres' best features is its > rich collection of date-manipulation functions. Please see: > > ... Hmmmm. The online docs appear to be down. When they're back up, > please check the sections on: Date/Time data types, and Date/Time > manipulation functions. > > -Josh Berkus > > P.S. Brian, a general tutorial on writing SQL, such as O'Reilly's > soon-to-be released SQL book, might help you a great deal. > > -- > ______AGLIO DATABASE SOLUTIONS___________________________ > Josh Berkus > Complete information technology josh@agliodbs.com > and data management solutions (415) 436-9166 > for law firms, small businesses fax 436-0137 > and non-profit organizations. pager 338-4078 > San Francisco -- Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.ipinc.com