Search Postgresql Archives

Re: oracle's first_value function for postgres?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Ben (bench@xxxxxxxxxxxxxxx) wrote:
> Oracle has a very handy function called first_value, which can be used 
> to turn a set like this:
> 
> a   10
> a   3
> b   1
> c   30
> c   10
> d   1
> d   20
> 
> ...into this:
> 
> a   10
> b   1
> c   30
> d   1
> 
> Does postgres have something equivalent, or, even better, is there a 
> reasonable way to express this in standard SQL?

Isn't this just: distinct on (col1)?

	Stephen

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux