I am trying to select data from 2 tables, Game and Team. I have a list of games in the Game table, where there are columns named htID, atID, apiID and a few others; and I would like to grab the names of these teams from the Team database.
I am currently using multiple SQL statements, which work in theory but not in my program due to the fact that I cannot open more than one database reader at a time.
SELECT * FROM Game WHERE Played = 0 ORDER BY DT ASC
SELECT TN FROM Team WHERE apiID = htID
SELECT TN FROM Team WHERE apiID = atID
(where htID and atID are variables in my program containing the ID's grabbed from the first SQL result)
Is there any way I can do the above with only one statement?