Got a hard one for you.

Results 1 to 2 of 2

Thread: Got a hard one for you.

  1. #1
    Join Date
    Dec 1969

    Default Got a hard one for you.

    I am trying to automate my RPG and there is the option to spar with your teammembers. Want I want to do is go out and look at the table "teams" and return the team information for that players team. Then compare the information from that table (which would be the Player Name) with the information in a table called "PlayerINFO" and see if they are at the same locaiton as the Player. SO if player "A" is at Earth and his team Captain (Player "B") is too and they both want to spar it will reconize it. I hope that is not too confusing.

  2. #2
    Join Date
    Dec 1969

    Default RE: Got a hard one for you.

    If I were you I&#039;d have the following tables:<BR><BR>Teams (nTeamID, cTeamName)<BR>Players (nPlayerID, cPlayerName, nTeamID, nLocationID)<BR>Locations (nLocationID, cLocationName)<BR><BR>then the following SQL will do what you describe:<BR><BR>SELECT<BR> P2.cPlayerName<BR>FROM<BR> Players AS P1 <BR> INNER JOIN Players AS P2 ON P2.nTeamID = P1.nTeamID AND P2.nLocationID = P1.nLocationID<BR>WHERE<BR> P1.cPlayerID = @nPlayerID<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts