Re: Doing multiple joins on one table



Often, the quality of the responses received is related to our ability to
'bounce' ideas off of each other. In the future, to prevent folks from
wasting time on already answered questions, please:

Don't post to multiple newsgroups. Choose the one that best fits your
question and post there. Only post to another newsgroup if you get no answer
in a day or two (or if you accidentally posted to the wrong newsgroup), and
indicate that you've already posted elsewhere.

If you really think that a question belongs into more than one newsgroup,
then use your newsreader's capability of multi-posting, i.e., posting one
occurrence of a message into several newsgroups at once. If you multi-post
appropriately, answers 'should' appear in all the newsgroups. Folks
responding in different newsgroups will see responses from each other, even
if the responses were posted in a different newsgroup.


--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


"Yaniv Danan" <yaniv@xxxxxxxx> wrote in message
news:%23H5gKXszGHA.2516@xxxxxxxxxxxxxxxxxxxxxxx
I have those Tables:

CREATE TABLE GameYellows(

id INT NOT NULL AUTO_INCREMENT,

AddedDate DATETIME NOT NULL,

Player_ID INT NOT NULL,

)

CREATE TABLE GameReds(

id INT NOT NULL AUTO_INCREMENT,

AddedDate DATETIME NOT NULL,

Player_ID INT NOT NULL,

)

CREATE TABLE GameSubstitutes(

id INT NOT NULL AUTO_INCREMENT,

OutPlayer_ID INT NOT NULL,

InPlayer_ID INT NOT NULL,

)

CREATE TABLE Players(

id INT NOT NULL AUTO_INCREMENT,

FullName VARCHAR(250) NOT NULL,

)

What i need is actually to get a table of statistics for each player in
the players table.

meaning i need to return a table like this:

id | yellows | reds | substitutes_out | substitutes_in

---------------------------------------------------------------------

1 | 2 | 1 | 5 | 2

2 | 4 | 0 | 0 | 3

3 | 1 | 2 | 0 | 7



please help me solve this one, having hard time using join.

thanks, Yaniv.




.



Relevant Pages

  • Re: For Us Older Girls
    ... interest to some of our posters, as participation in these newsgroups ... folks, and in instances like this, all one has to do is ask questions. ... And it has engendered some thoughtful and interesting responses. ... Be on your guard. ...
    (soc.culture.scottish)
  • Re: For Us Older Girls
    ... interest to some of our posters, as participation in these newsgroups ... folks, and in instances like this, all one has to do is ask questions. ... And it has engendered some thoughtful and interesting responses. ... Be on your guard. ...
    (soc.culture.scottish)
  • Re: For Us Older Girls
    ... interest to some of our posters, as participation in these newsgroups ... folks, and in instances like this, all one has to do is ask questions. ... And it has engendered some thoughtful and interesting responses. ...
    (soc.culture.scottish)
  • Re: Checkpoints
    ... the quality of the responses received is related to our ability to ... In the future, to prevent folks from ... Don't post to multiple newsgroups. ... The idea is, to set a checkpoint,, and when its ...
    (microsoft.public.sqlserver.msde)
  • Re: One for the MVPs?
    ... easily received WAG's or no responses at all. ... The Access newsgroups are fortunate in that there are enough experts to give ... devote to assisting with any particular database problem. ... The page layout and spacing of controls may look the same in both the report ...
    (microsoft.public.access.forms)

Loading