MySQL Forums
Forum List  »  Newbie

Re: count of a certain value in two columns
Posted by: Khaba
Date: July 16, 2005 01:18PM

Thanks another time...

... in this case I have to know the ID of the assistman. What if I don't know it or if I generally want to display a sorted list?

By the way.. can it be, that I can not use an aggregate field in the where clause?

The following query generate an error: #1054 - Unknown column 'nr_of_items' in 'where clause'

SELECT game, sum( p1 *2 + p2 *5 + p3 *10 + p4 *20 ) AS nr_of_items
FROM playergame
WHERE player =1010
AND nr_of_items > 0
GROUP BY game
ORDER BY nr_of_items DESC

Options: ReplyQuote


Subject
Written By
Posted
Re: count of a certain value in two columns
July 16, 2005 01:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.