Re: Help with SQL staterment

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Chris Campbell <ccampbell(at)cascadeds(dot)com>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Help with SQL staterment
Date: 2011-06-30 23:23:41
Message-ID: 4E0D057D.6040809@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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.

Cheers,
Steve

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Thom Brown 2011-06-30 23:28:31 Re: Help with SQL staterment
Previous Message Thom Brown 2011-06-30 23:04:46 Re: Help with SQL staterment