pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: sqllist <pgsql-sql@postgresql.org>
Subject: Re: if else query help
Date: Thu, 12 Oct 2000 08:35:39 -0700
Message-ID: <39E5DA4B.DCE967D6@agliodbs.com> (raw)
References: <5.0.0.25.2.20001012094914.081abeb0@pop.mindspring.com>
	<6812102772.20001012165653@thefreecat.org>

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



view thread (5+ messages)  latest in thread

Message-ID: <39E5DA4B.DCE967D6@agliodbs.com>
Permalink:  ../39E5DA4B.DCE967D6@agliodbs.com/
Also on:    postgresql.org/message-id/39E5DA4B.DCE967D6@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com
  Subject: Re: if else query help
  In-Reply-To: <39E5DA4B.DCE967D6@agliodbs.com>
  References: <5.0.0.25.2.20001012094914.081abeb0@pop.mindspring.com> <6812102772.20001012165653@thefreecat.org> <39E5DA4B.DCE967D6@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox