Re: Advise with a select statement - Mailing list pgsql-novice

From Sachin Srivastava
Subject Re: Advise with a select statement
Date
Msg-id CE9B9481-67A3-4AD5-A0FA-C265308B3493@enterprisedb.com
Whole thread Raw
In response to Advise with a select statement  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Responses Re: Advise with a select statement
List 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 by date:

Previous
From: JORGE MALDONADO
Date:
Subject: Advise with a select statement
Next
From: Lew
Date:
Subject: Re: Choosing character set for database