Re: deciding on one of multiple results returned - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: deciding on one of multiple results returned
Date
Msg-id CAOR=d=2Mu3_rKK55h=t5p9KaYwOFcsC2MvWwFcSebcb8cSyGmg@mail.gmail.com
Whole thread Raw
In response to Re: deciding on one of multiple results returned  (Wes James <comptekki@gmail.com>)
Responses Re: deciding on one of multiple results returned
List pgsql-sql
On Fri, Dec 21, 2012 at 10:28 AM, Wes James <comptekki@gmail.com> wrote:
> David and Seth Thanks.  That helped.
>
>
> When I have
>
> select distinct on (revf3)  f1, f2, f3, revers(f3) as revf3 from table order
> by revf3
>
> Is there a way to return just f1, f2, f3 in my results and forget revf3 (so
> it doesn't show in results)?

Sure just wrap it in a subselect:

select a.f1, a.f2, a.f3 from (select distinct on (revf3)  f1, f2, f3,
revers(f3) as revf3 from table order by revf3) as a;



pgsql-sql by date:

Previous
From: Wes James
Date:
Subject: Re: deciding on one of multiple results returned
Next
From: Wes James
Date:
Subject: Re: deciding on one of multiple results returned