home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / oracle / 2677 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  1.5 KB

  1. Path: sparky!uunet!hayes!fgreene
  2. From: fgreene@hayes.com
  3. Newsgroups: comp.databases.oracle
  4. Subject: Re: 40 values in desc order
  5. Message-ID: <6622.2b485a61@hayes.com>
  6. Date: 4 Jan 93 15:40:17 EDT
  7. References: <Bzo2t0.67@lut.fi>
  8. Organization: Hayes Microcomputer Products, Norcross, GA
  9. Lines: 26
  10.  
  11. In article <Bzo2t0.67@lut.fi>, hietanen@lut.fi (Pentti Hietanen) writes:
  12. > What kind of sql sentence should we use to get 40 values
  13. > from database in descending order?
  14. > Pentti Hietanen, student of Lappeenranta University of Technology, Finland.
  15. > internet: hietanen%lut.fi
  16.  
  17.  
  18. Probably the easiest way is to use the ROWNUM function.  For example,
  19.  
  20.     SELECT field1, field2, fieldn
  21.     FROM   the_table
  22.     WHERE  ROWNUM < 40;
  23.  
  24.  ----------------------------------------------------------------------------
  25.  |      Frank Greene                  |          //////  //////             |
  26.  |      DELPHI SYSTEMS, Inc.          |           ////    ////              |
  27.  |      Telephone [615] 458-6032      |          ////    ////  //////       |
  28.  |      Compuserve 74200,427          |         ////    ////    ////        |
  29.  |      324 Ootsima Way               |        ////    ////    ////         |
  30.  |      Loudon, TN 37774              |       //////  //////  //////        |
  31.  ----------------------------------------------------------------------------
  32.  |         Of course, any opinions or suggestions are strictly my own       |
  33.  ----------------------------------------------------------------------------
  34.  
  35.