Re: deciding on one of multiple results returned

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'Wes James'" <comptekki(at)gmail(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: deciding on one of multiple results returned
Date: 2012-12-21 16:46:23
Message-ID: 00a201cddf9a$b667b560$23372020$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org]
On Behalf Of Wes James
Sent: Friday, December 21, 2012 11:32 AM
To: pgsql-sql(at)postgresql(dot)org
Subject: [SQL] deciding on one of multiple results returned

If a query returns, say the following results:

id value
0 a
0 b
0 c
1 a
1 b

How do I just choose a preferred element say value 'a' over any other
elements returned, that is the value returned is from a subquery to a larger
query?

Thanks.

ORDER BY

(with a LIMIT depending on circumstances)

David J.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Seth Gordon 2012-12-21 16:57:22 Re: deciding on one of multiple results returned
Previous Message Wes James 2012-12-21 16:31:58 deciding on one of multiple results returned