Re: deciding on one of multiple results returned

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: deciding on one of multiple results returned
Дата
Msg-id 00a201cddf9a$b667b560$23372020$@yahoo.com
обсуждение исходный текст
Ответ на deciding on one of multiple results returned  (Wes James <comptekki@gmail.com>)
Список pgsql-sql

From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Wes James
Sent: Friday, December 21, 2012 11:32 AM
To: pgsql-sql@postgresql.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.

 

В списке pgsql-sql по дате отправления:

Предыдущее
От: Wes James
Дата:
Сообщение: deciding on one of multiple results returned
Следующее
От: Seth Gordon
Дата:
Сообщение: Re: deciding on one of multiple results returned