Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2011
    Posts
    85

    Unanswered: Delete Data to According Date

    Hi

    I have a table which have huge amount of data.

    ID MSG TYPE SMALLCONT LARGECONT AUDID CREATETIMESTAMP

    So i want to delete data except IDs which are less than 15 days old.

    Can you help me with a query.

    Also i want to grab the IDs which im deleting ,because this is a Production TEST env and I want to avoid DB locks as well...

    Can you plz suggest me a way to solve this problem.

    Thanx

  2. #2
    Join Date
    Oct 2009
    Location
    221B Baker St.
    Posts
    486
    Where are you stuck? What do you want to do with IDs after you "grab"them.

    If you are deleting rows, why is the a concern if they are locked? They shouldn't be referenced to get locked?

    Either this is far more starightforward than the questions ask or i am missing something.

  3. #3
    Join Date
    Sep 2011
    Posts
    85
    Thanx for the reply

    My question is delete data except IDs which are less than 15 days old

    I figure out rest of the problems during this time...

    If you can suggest me a SQL my problem will solve

  4. #4
    Join Date
    Oct 2007
    Posts
    246
    select id from hugetable where createtimestamp = ( current timestamp - 15 days )
    delete hugetable where createtimestamp = ( current timestamp - 15 days )

    not sure will this help

    paul

  5. #5
    Join Date
    Sep 2011
    Posts
    85

    Pass Date parameters

    Thanx paul....
    Last edited by ai_zaviour; 09-25-12 at 12:12.

Posting Permissions

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