Hello,

I know this is not directly related to SQLite, but hopefully
someone has the time to help me with a (probably) basic SQL question:

Consider the following tables:

CREATE TABLE teams (id,name);
CREATE TABLE games (id, date, team1_id, team2_id, result);

team1_id and team2_id refer to the id in the teams table.

1. What query would be best suited to get an output so that the
output would contain the teams names (not only the id) and the
dates and results?

2. What query would be best if I want to search for games that
two specific teams had played. For example, I want all the games
that the teams with the names 'bla' and 'blub' played against
each other. Is there any way to do that?

I tried this with joins, with groupings, but wasn't able to get
the lists i wanted. I can get the name of one team, but not the
name of the other team.

Any help would be appreciated

Gilbert

Reply via email to