From: | Jeff Brown <jbrown(at)fastrans(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | help with join |
Date: | 1998-07-11 05:22:41 |
Message-ID: | 35A6F6A1.E44513BB@fastrans.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
I am looking for some sql help. The SCHEDULES table has a row for every
football game of the year. Each row has the week number, three letter
code for the home team, three letter code for the away team, and three
letter code for the winner. The TEAMS table has a row for every team.
Each row has the three letter team code, the long name of the team and
other info that is not relevant to this problem.
Here are the two tables...
Table SCHEDULES
WEEK int not null,
HOME char(3) not null,
AWAY char(3) not null,
WINNER char(3)
Table TEAMS
CODE char(3) not null,
NAME char(25) not null
What I want to do is select all of the games for a particular week, and
get both the three letter codes and the long team names for both teams.
Example:
WEEK| HOME | HOME_NAME | AWAY | AWAY_NAME
1 | STL | St. Louis Rams | ARI | Arizona Cardinals
1 | MIN | Minnesota Vikings | WAS | Washington Redskins
I would really appreciate some help with the sql here.
Thanks!
Jeff
--
/**
* @author Jeff S. Brown
*
* @return jbrown(at)fastrans(dot)net
*
* @see http://jbrown.fastrans.net
*/
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Brown | 1998-07-11 15:58:04 | help with join |
Previous Message | Jackson, DeJuan | 1998-07-10 17:37:35 | RE: [SQL] Single vs. multiple indexes |