Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Why doesn't thi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3008 of 3322
Post > Topic >>

Why doesn't this query work? Puzzle to hard for me to crack

by killen.nextdoor@[EMAIL PROTECTED] ("sdger erger") Feb 20, 2008 at 04:41 PM

------=_Part_18651_7901211.1203522071954
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

This query works as I want it to:

SELECT sum(cutoffuohands) AS HANDS, sum(cutoffuopfr) AS pfr
FROM compiledplayerresultspositionaction
JOIN compiledresults
ON compiledplayerresultspositionaction.compiledplayer results_id =
compiledresults.compiledplayerresults_id
JOIN players
ON compiledresults.player_id = players.player_id
WHERE playername = 'Robert'

It returns the number of "cutoffuohands" and the number of "cutoffuopfr"
for
the player Robert.

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

But this similar query does not work as I want it to do:

SELECT sum(cutoffuohands) AS HANDS, sum(cutoffuopfr) AS pfr
FROM compiledplayerresultspositionaction
JOIN compiledresults
ON compiledplayerresultspositionaction.compiledplayer results_id =
compiledresults.compiledplayerresults_id
JOIN players
ON compiledresults.player_id = players.player_id
WHERE playername = 'Robert'


I want it to return all the "cutoffuohands" and "cutoffuopfr" for all
players not named Robert. But it returns unreasonable numbers.

Unfortunately I don't know much about the inner workings of the database
and
unfortunately I'm only a novice with SQL so I haven't been able to figure
out how to fix the second query. I hope you guys here on the mailing list
can take a lot at this and see if you can figure it out.

Thanks!

------=_Part_18651_7901211.1203522071954
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

This query works as I want it to:<br><br>
			
				SELECT sum(cutoffuohands) AS HANDS, sum(cutoffuopfr) AS pfr<br>
FROM compiledplayerresultspositionaction<br>
JOIN compiledresults<br>
ON compiledplayerresultspositionaction.compiledplayer  results_id =
compiledresults.compiledplayerresults_id<br>
JOIN players<br>
ON compiledresults.player_id = players.player_id<br>
WHERE playername = &#39;Robert&#39;<br><br>It returns the number of
&quot;cutoffuohands&quot; and the number of &quot;cutoffuopfr&quot; for
the player Robert.
<br><br>--------------------------------------------------------<br>
<br>But this similar query does not work as I want it to do:<br><br>
			
				SELECT sum(cutoffuohands) AS HANDS, sum(cutoffuopfr) AS pfr<br>

FROM compiledplayerresultspositionaction<br>

JOIN compiledresults<br>

ON compiledplayerresultspositionaction.compiledplayer  results_id =
compiledresults.compiledplayerresults_id<br>

JOIN players<br>

ON compiledresults.player_id = players.player_id<br>

WHERE playername = &#39;Robert&#39;<br><br><br>I want it to return all the
&quot;cutoffuohands&quot; and &quot;cutoffuopfr&quot; for all players not
named Robert. But it returns unreasonable numbers.<br><br>Unfortunately I
don&#39;t know much about the inner workings of the database and
unfortunately I&#39;m only a novice with SQL so I haven&#39;t been able to
figure out how to fix the second query. I hope you guys here on the mailing
list can take a lot at this and see if you can figure it out.<br>
<br>Thanks!<br> 

------=_Part_18651_7901211.1203522071954--
 




 2 Posts in Topic:
Why doesn't this query work? Puzzle to hard for me to crack
killen.nextdoor@[EMAIL PR  2008-02-20 16:41:11 
Re: Why doesn't this query work? Puzzle to hard for me to
fbax@[EMAIL PROTECTED] (  2008-02-20 11:36:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 4:29:55 CST 2008.