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

Home -> Community -> Usenet -> c.d.o.server -> Re: Getting first/last record

Re: Getting first/last record

From: Brian Peasland <peasland_at_email.msn.com>
Date: Wed, 14 Jul 1999 22:36:50 -0500
Message-ID: <OBhsHOnz#GA.396@cpmsnbbsa02>


>Being a bit of a newbee, to oracle8 can anybody help with the following.
>1.How to get the first record in an ordered table
>2 How to get the last record in an ordered table.
>the order being on date then time.

The Oracle DATE format stores both the date and the time in one field. So you can just query the date field. Assuming the table is named 'TABLEX' and the date field is labelled 'COLX', try this:

   SELECT min(COLX), max(COLX) from TABLEX;

Hope that helps,
Brian Peasland
peasland_at_msn.com Received on Wed Jul 14 1999 - 22:36:50 CDT

Original text of this message

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