Dear ones ,
I am new to this forum and after having tried them all .... really all,
I decided to write to you hoping someone would have 5 minutes free for me.
My need is simple enough for you. I'll explain the situation to you.
I have three tables:
results (id, idrace, idathlete, etc, etc,)
races (id, name, etc, etc)
athletes (id, name, etc, etc)
then there are other fields that are not interesting right now.
The query I have to do is input two idathete and what I need and '
the display of the only events to which both of them participated.
To give you an example, let's talk about Tennis.
results (1, 11, 21)
Results (2, 12, 21)
Results (3, 12, 22)
races (11, "TENNIS BACK 1")
races (12, "TENNIS BACK 2")
athletes (21, "Bill Clinton")
athletes (22, "Jorge Bush")
so I see the tournament "2" with the participation of both.
The "mother" table results are linked to the other two so:
results, races
---------, ---------
idrace -------------> id
results, athletes
---------, ---------
idathlete -------------> id
apart from the scheme a bit too rough, I can tell you there are constraints
of referential integrity between the three tables or:
results (idathlete) -> Athletes (id)
results (idrace) -> races (id)
So my goal is to show, and not count, only the results
where the two athletes are present as inputs.
Who can help me?
Thank you all !
Greetings
Willy