just ensure the table has not duplicate records like..
Either define the table as SET which will have CPU-I/O overhead for duplicate row check
Or before executing above query check duplicates by
sel
Serial_Number,
Send_Date ,
File_Number
from
<<Source_Table>>
group by
Serial_Number,
Send_Date ,
File_Number
Having count(*) > 1 ;
Serial_Number
Send_Date
File_Number
876543890
1-Jan-13
345
876543890
1-Jan-13
345
876543890
1-Jan-13
347
if there are duplicates then above query will not give proper answers.
↧