Search Postgresql Archives
get first and last row in one sql as two columns
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Subject
: get first and last row in one sql as two columns
From
: Tom Smith <
tomsmith1989sk@xxxxxxxxx
>
Date
: Wed, 2 Sep 2015 19:14:40 -0400
Hi:
I need to get the first and last tow in one sql like below
select first(col1), last(col1) from table order by col1
I saw some posting in wiki with a custom function (or C extention)
to do this. Is it widely used and reliable?
https://wiki.postgresql.org/wiki/First/last_(aggregate)
I am wondering why these two functions are not part of postgresql built-in
functions as it has many use cases
Thanks
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Follow-Ups
:
Re: get first and last row in one sql as two columns
From:
Dickson S. Guedes
Re: get first and last row in one sql as two columns
From:
Rob Sargent
Re: get first and last row in one sql as two columns
From:
Rob Sargent
Prev by Date:
Re: bdr admin role
Next by Date:
Re: get first and last row in one sql as two columns
Previous by thread:
bdr admin role
Next by thread:
Re: get first and last row in one sql as two columns
Index(es):
Date
Thread
[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]