Thanks Pinakin and Kris109. I guess cursor for loop will help me handle the duplicate output.