This may be a bit extreme, but:
You might consider putting the results into a collection rather than an array.
If you create a class to hold the values, when you add the object to the collection, you can assemble the key from the values in the table.
If the key exists, you will get a trappable error when you try to add the object, and you can then do a resume next.
The end result will be a collection with only distinct values.