MySQL Forums
Forum List  »  Newbie

query returning 0 as a result
Posted by: Pat Buscio
Date: August 17, 2010 11:52AM

Hi, I have the following query

SELECT `tblCurrentWinStreak`.`PlayerID` AS PlayerID_1, If(`currentWinStreak` ="0", "Lost " & `currentLossStreak`, "Won " & `currentWinStreak`) AS `CurrentStreak`
FROM `tblCurrentWinStreak` INNER JOIN `tblCurrentLossStreak` ON `tblCurrentWinStreak`.`PlayerID` = `tblCurrentLossStreak`.`PlayerID`
GROUP BY `tblCurrentWinStreak`.`PlayerID`, `tblCurrentWinStreak`.`currentWinStreak`, `tblCurrentLossStreak`.`currentLossStreak`;

When i run it i get all the players names but 0 as the currentstreak. It should say won or lost and then a number. if i take out the & currentlossstreak and the & currentwinstreak, i get a result of won or lost which is correct. how do i get the number to also show? i set the number field in each table i am using to text. any thoughts would be helpful.

Thanks

Options: ReplyQuote


Subject
Written By
Posted
query returning 0 as a result
August 17, 2010 11:52AM


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.