pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
help with join
2+ messages / 1 participants
[nested] [flat]

* help with join
@ 1998-07-11 05:22  Jeff Brown <jbrown@fastrans.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Jeff Brown @ 1998-07-11 05:22 UTC (permalink / raw)
  To: 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@fastrans.net
 *
 * @see http://jbrown.fastrans.net
 */






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* help with join
@ 1998-07-11 15:58  Jeff Brown <jbrown@fastrans.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Jeff Brown @ 1998-07-11 15:58 UTC (permalink / raw)
  To: 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@fastrans.net
 *
 * @see http://jbrown.fastrans.net
 */






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1998-07-11 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-07-11 05:22 help with join Jeff Brown <jbrown@fastrans.net>
1998-07-11 15:58 help with join Jeff Brown <jbrown@fastrans.net>

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