Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Subtracting min(date) from date column

Re: Subtracting min(date) from date column

From: Roland Cont <roland_at_dse.it>
Date: Thu, 23 Sep 1999 08:39:15 +0200
Message-ID: <7schnn$oft$1@fe1.cs.interbusiness.it>


Create a DB function to get the minimum date and include the function in your SELECT-statement

CREATE OR REPLACE FUNCTION get_minimum_date RETURN DATE IS
  min_date date;
BEGIN
  SELECT min (entry_datetime)
    INTO min_date
    FROM mytable;
  RETURN min_date;
END;
/

SELECT entry_datetime - get_minimum_date FROM mytable;

           Roland Cont
--

Have a nice day!



Roland Cont
D.S.E. - Dator Software Engineering
Buozzistr. 8
39100 BOZEN - ITALIEN
e-Mail: roland_at_dse.it
Received on Thu Sep 23 1999 - 01:39:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US