I have a dilema which stems from a poorly designed table. (Although at the time I had a reason for designing it the way I did.) Basically I have a list of schedules for 100 teams. Each team has an id, and all the games for each team are in the database. The problem is that each game is listed twice (once for each team playing), and I only want to show it once. For instance, if I want to list the games on 8/26, the results might look like this:
| team_id | game_date | home_away | opponent_id | result |
|_____________________________________________|_____|
| 1 | 2000-08-26 | h | 2 | w |
|------------------------------------------------|--------|
| 2 | 2000-08-26 | a | 1 | l |
|------------------------------------------------|--------|
| 3 | 2000-08-26 | a | 4 | l |
|------------------------------------------------|--------|
| 4 | 2000-08-26 | h | 3 | w |
When I list the games, it will list each game twice, once for each team. My question is, how do I get it to recognize that it is the same game, and only list it once? Or, if it would be more logical to redesign the table, can anyone offer some suggestions on how to go about that? Any and all suggestions are appreciated. Thanks!