MySQL Forums
Forum List  »  Newbie

Re: count of a certain value in two columns
Posted by: Jay Pipes
Date: July 16, 2005 12:48PM

Player 123 got X assists from 124:

SET @playerid = 123; // Some player ID
SET @assistplayerid = 124; // Some player ID

SELECT COUNT(*)
FROM scorelist
WHERE player = @playerid
AND (
OR a1 = @assistplayerid
OR a2 = @assistplayerid
);

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


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


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.