Re: Advise with a select statement

Поиск
Список
Период
Сортировка
От Sachin Srivastava
Тема Re: Advise with a select statement
Дата
Msg-id CE9B9481-67A3-4AD5-A0FA-C265308B3493@enterprisedb.com
обсуждение исходный текст
Ответ на Advise with a select statement  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Ответы Re: Advise with a select statement  (Chetan Suttraway <chetan.suttraway@enterprisedb.com>)
Список pgsql-novice
A naive and simple solution is: (Let the table name is table1)
SELECT a.Team, a.Score FROM table1 a, table1 b WHERE a.Score = b. Score and a.Team != b.Team;

On Apr 21, 2011, at 10:35 PM, JORGE MALDONADO wrote:

If I have a table that has a column where values can be the same, how can I SELECT them?
For example, consider the following table:
 
--------------------------------------
    Team             Score
--------------------------------------
       T1                  500
       T2                  510
       T3                  505
       T4                  499
       T5                  500
       T6                  508
       T7                  505
       T8                  498
       T9                  501
 
As you can see, T1 and T5 have a score of 500; and T3 and T7 have a score of 505. What I want is a SELECT to get only these four records.
 
Respectfully,
Jorge Maldonado

--
Regards,
Sachin Srivastava

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

Предыдущее
От: JORGE MALDONADO
Дата:
Сообщение: Advise with a select statement
Следующее
От: Lew
Дата:
Сообщение: Re: Choosing character set for database