> On 06/30/2011 04:04 PM, Thom Brown wrote:
>>
>> SELECT DISTINCT ON (contactkey)
>> paymentkey, contactkey, paymentdate
>> FROM
>> my_table
>> ORDER BY
>> contactkey, paymentdate DESC
>
> Gives the same result as my example but your solution is much cleaner.
I would have never thought that "SELECT DISTINCT ON" would return that result set, but amazingly it works like a charm. Obviously I need to study up on that syntax.
Many thanks for all the assistance.
Chris