|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
MySQL - League Query...
I do have a table which looks like this
id | winner | loser | winnergoals | losergoals I like to calculate the amount of goals scored by a certain player...a player can be a winner or a loser... With the query below...I only get the goals-scored as a winner...I want to add the goals scored as a loser inside this query...does anyone have an idea how to get this working? Code:
SELECT uitslagen.winner,
SUM(uitslagen.winnergoals) as GoalsScored
FROM uitslagen
WHERE confirm = 1
GROUP BY uitslagen.winner
ORDER BY AantalGoals DESC
|
|
#2
|
|||
|
|||
|
nobody?
|
|
#3
|
|||
|
|||
|
Chrissie,
Do you want to show both columns for each user: Name GoalsAsAWinner GoalsAsALoser x 9 9 Or do you want to display the appropriate column based on whether the team/player won or lost?
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > MySQL - League Query... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|