2 Replies Latest reply: Aug 1, 2013 5:00 AM by Mike-Matthews-Oracle RSS

    Duplicates even though "Union" is being  used in the query

    49832acd-dc32-4290-9441-1776297000d8

      I am getting duplicates sometimes in table. Let me tell you my scenario with example so that it would be helpful for me to get answers.

      I have three tables  Stage1, Stage2 and Final_Stage. I have simple procedure which  loads into these three tables. 

      Final_Stage table is a union of Stage1 and Stage2 ( select * from Stage1 union Select * from Stage2)

      example records in staging tables:

      Stage1

      1

      2

      3

      4

      5

      Stage2

      3

      4

      5

      6

      7

      After doing the Union the desired output in Final_Stage  is  1

      2

      3

      4

      5

      6

      7

      but sometimes i am getting duplicates in  Final_Stage tables. 

       

      my  question is  if CPU utilization of DB machine  is 100 % or DB load is high  does "Union" don't work at all(will it give duplicates instead of distinct records)  What would be the scenario and how to handle . Please help me ..

       

      Thanks,

      Sandeep C