Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group