From: Jeff Brown <jbrown@fastrans.net>
To: pgsql-sql@postgresql.org
Subject: help with join
Date: Sat, 11 Jul 1998 10:58:04 -0500
Message-ID: <35A78B8C.B9937F90@fastrans.net> (raw)
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@fastrans.net
*
* @see http://jbrown.fastrans.net
*/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: jbrown@fastrans.net
Subject: Re: help with join
In-Reply-To: <35A78B8C.B9937F90@fastrans.net>
References: <35A78B8C.B9937F90@fastrans.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox