Thread: Sql command

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    76
    Rep Power
    12

    Sql command


    Hi, I'm using the oracle db..
    I'd like to retrieve first 10 records from table A.
    What is the sql command? Thank you..
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,784
    Rep Power
    348
    SELECT *
    FROM table
    WHERE rownum < 11
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    76
    Rep Power
    12
    Thanks Shammat...
    If my Table A has a field called A_Datetime(DataTime type), and I'd like to order the records in desc order(according to A_Datetime), then retrieve the first 10 records. What is the sql?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    68
    Rep Power
    11
    SELECT * FROM
    (SELECT *
    FROM A
    Order by A_Datetime desc)
    WHERE rownum < 11;
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    76
    Rep Power
    12
    Thanks, Dan Drillich

Similar Threads

  1. ftplib
    By XxChris in forum FTP Help
    Replies: 4
    Last Post: February 17th, 2004, 03:54 PM
  2. Phantom SQL Syntax Error
    By cparker in forum Perl Programming
    Replies: 3
    Last Post: February 12th, 2004, 12:38 PM
  3. SQL Statement Help
    By CrazyeD in forum ASP Programming
    Replies: 1
    Last Post: January 26th, 2004, 03:09 PM
  4. links by sql command.
    By itohideo in forum PHP Development
    Replies: 4
    Last Post: January 20th, 2003, 04:24 PM
  5. convert MS SQL to MySQL
    By hayden in forum MySQL Help
    Replies: 1
    Last Post: October 14th, 2001, 03:08 PM

IMN logo majestic logo threadwatch logo seochat tools logo