Eliminate duplicate records from query output