Results 1 to 2 of 2

Thread: Delete Query

  1. #1
    Join Date
    Jun 2003
    Posts
    5

    Unanswered: Delete Query

    Hi,

    I havent doen SQL for years now; and have a requirement.Since it is rather emergent, posting this.Would appreciate responses ASAP


    I am using DB2 V 7.3.

    I have 9800 records in a table and need to delete from the 5001th record till the end(4800).

    What would be the SQL command?

    Thanks

  2. #2
    Join Date
    Sep 2002
    Location
    Montreal, Canada
    Posts
    224
    Provided Answers: 1

    Re: Delete Query

    Originally posted by Amusix
    Hi,

    I havent doen SQL for years now; and have a requirement.Since it is rather emergent, posting this.Would appreciate responses ASAP


    I am using DB2 V 7.3.

    I have 9800 records in a table and need to delete from the 5001th record till the end(4800).

    What would be the SQL command?

    Thanks
    DELETE FROM tablename
    WHERE id in
    (SELECT ROWNUMBER() OVER (ORDER BY your_ordering_criteria) as seq
    FROM tablename
    WHERE seq > 5000)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •