Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL and Baseball what a combo.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-04-12 : 16:57:11
John writes "Hello SqlTeam, One of my side projects is doing development for an online fantasy baseball game. One of the most requested reports I get from users is as follows. Basically it is a Win/Loss Matrix for the every team vs every other team. Kind of like so.



Team1 Team2 Team3 Team4
Team 1 - 5-2 1-2 2-1
Team 2 2-5 - 3-4 1-5
Team 3 2-1 4-3 - 3-1
Team 4 1-2 5-1 1-3 -





The data I have to work with is basically a game results table with the following abriged structure.

Game_id int Identity,
Home_Team_id int,
Away_Team_id int,
HomeScore int,
AwayScore int

The actual amount of Teams in a league varies.

I'm not opposed to Temporary Tables, cursors, or anything else, as long as the result set still returns fast.

A typical league never has more that 1600 records in the gameresults table.

This is currently running on SQL7 sp3, but I'd welcome any solutions that had to rely on SQL200 as well."
   

- Advertisement -