Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    india,hyderabad
    Posts
    43

    Red face Unanswered: re: removing duplicate records

    hi! ,

    In a procedure

    I have a main cursor to select records ...

    the cursor consists of four select statements unioned....

    select 1
    union all
    select 2
    union all
    select 3
    union all
    select 4

    it is necessary to use union all instead of union to reduce processing
    time ...

    how can i remove duplicate records if they come up using pl/sql in the proc ?


    thanks for any help suggestions tip etc ..
    harry

  2. #2
    Join Date
    Jan 2004
    Posts
    37
    instead of union all use union that will solve the problem ....
    union all will pick up all the records even if there are duplicates while union will not....

  3. #3
    Join Date
    Sep 2003
    Location
    india,hyderabad
    Posts
    43
    Originally posted by chiranjib_s
    instead of union all use union that will solve the problem ....
    union all will pick up all the records even if there are duplicates while union will not....

    note **
    it is necessary to use union all instead of union to reduce processing
    time ...
    harry

  4. #4
    Join Date
    Jan 2004
    Posts
    37
    use

    delete from <table name> a where rowid >
    (select min(rowid) from <table_name> b
    where a.field1 = b.field1
    and a.field2 = b.field2
    .....)

    this is a self join
    and a b are same table basically
    and the field combination should be such wich makes the record to be identified uniquely...

Posting Permissions

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