Jump to content

Recommended Posts

Hey everyone,

 

I've made a stat database for a softball team. I have all the information in but im having problems printing out some results.

 

the way i have it set up is, a game table, player table and playerstats table. in the playerstats table, i have the game, player and a bunch of stats.

 

I'm trying to print out the names of all the players on the roster and then use COUNT to find out how many games they appear in.

 

when i use this query, it works for 1 predefined player (in the where clause)

 

SELECT player.playerID,player.playerFirstName, player.playerLastName, COUNT(playerstats.playerID)

FROM playerstats INNER JOIN player ON (playerstats.playerID=player.playerID)

WHERE playerstats.playerID='1';

 

however, whenever i take out the where clause, it just prints out the first players name and then counts all the players appearences. IE) Ron Johnson has played 265 games.

 

any ideas what the problem is? thanks!

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.