Results 1 to 3 of 3

Thread: Delete Dup data

  1. #1
    Join Date
    Apr 2004
    Posts
    113

    Unanswered: Delete Dup data

    I need to delete the dup data out of a table.

    I have done a select distinct and inserted the correct data into a temp table.
    Now I want to delete all the data from the history table so that I can insert the correct data.
    The problem is I need to delete the data from this table but only for a particular description and date.

    For example:

    The table's ddl is:

    CREATE TABLE DB.T_HIST
    (
    CALLER_REC_NO NUMBER(10) NULL,
    INFO_REQ_NO NUMBER(30) NULL,
    MARKET_CODE CHAR(2) NULL,
    INFO_REQ_REASON_DESC CHAR(30) NULL,
    INFO_REQ_START_TIME DATE NULL,
    INFO_REQ_STOP_TIME DATE NULL,
    TOT_QRY_QTY NUMBER(10) NULL,
    SERV_PNTR_NO NUMBER(10) NULL,
    LANG_ID_CODE NUMBER(10) NULL
    )
    TABLESPACE DB
    LOGGING
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE(BUFFER_POOL DEFAULT)
    NOPARALLEL
    NOCACHE
    /

  2. #2
    Join Date
    Apr 2003
    Location
    NY
    Posts
    208
    PHP Code:
    DELETE 
    FROM DB
    .T_HIST 
    WHERE INFO_REQ_REASON_DESC 
    'value'
       
    AND INFO_REQ_START_TIME >= TO_DATE('99/99/9999','mm/dd/yyyy')
       AND 
    INFO_REQ_STOP_TIME  <= TO_DATE('99/99/9999','mm/dd/yyyy'

  3. #3
    Join Date
    Apr 2004
    Posts
    113
    Thank you carloa!

Posting Permissions

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