|
|
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Dear experts at this moment i have an issue with finding overall of each team from futball related database: Here is my tables wd_timeline it is for track what happened during match: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. Sample output from wd_timeline: And table wd_matches: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Sample Output from wd_matches: Table wd_teams: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. From wd_teams: And finally Here is my query for finding out which team wins or stay draw(ничья): Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. Output from final query: So now i want to count a final point for each team. For eg: team "Qebele" wins 1 time for "away" and 1 time for "home" it will mean 6 points for final result. How i can accomplish this? Or maybe you suggest different query for this purpose. Any help appreciated. Thanks. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 13:28:26 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Shahriyar.R, Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 15:10:00 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Cygapb-007 Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 15:16:27 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Cygapb-007, Please explain your queries. i cant figure out what happened here :) For my question, i solve this with this query: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. Output: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 15:19:47 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Cygapb-007, I edited slightly your last query and result is EXCELLENT! Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 15:32:36 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Shahriyar.R, Add scripts for insert the sample data please. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 16:06:19 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Cygapb-007, Also added total match_count: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. Output: ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 16:07:07 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 16:12:35 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Cygapb-007 Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. Output truncates 0 point commands: But previous one works great. Thanks ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 16:20:49 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 16:25:12 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Dear Cygapb-007 thanks for great assist i have nearly finished this task: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. For completion of task i need the last thing the Goals, which each command get: goal forward(GF) and goal against(GA). (забил) (пропустил) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 17:01:46 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 18:04:45 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Dear Cygapb-007, As you stated last, i change "from" clause: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. Output from query: But actually "Qebele" has 6 goals: How we can fix it? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 22:49:12 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Код: sql 1. 2. 3. 4. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 23:02:36 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Cygapb-007, uupppssss ))))) Great! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 23:09:38 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Cygapb-007, how i can email or PM you? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 23:11:07 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 16.09.2013, 23:24:59 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Cygapb-007 Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. Dear Cygapb-007 everything was ok but occasionally i found out that total_matchs doesnt match actual match count. From query above: But actually all commands play 6 matches. Here is eg of "Xezer Lenkeran": Код: sql 1. So how i can fix it to count total_matches correctly? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.09.2013, 14:21:20 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
SorryCygapb-007 Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.09.2013, 19:18:47 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Это тебе поможетselect t . *, (t.wins * 3 + t.draw * 1) score from (select (select name from wd_teams where id = t.team) team_name, (count(t.match)) total_matches, sum(t.team_goal) gf, sum(t.ga) ga, sum(t.wins) wins, sum(t.lost) lost, sum(t.draw) draw from (select t . *, (total_goals - t.team_goal) < team_goal wins, (total_goals - t.team_goal) > team_goal lost, (total_goals - t.team_goal) = team_goal draw, (total_goals - t.team_goal) GA from (SELECT tl.id, tl.match, tl.team, sum(goal) team_goal, (select sum(tl2.goal) from wd_timeline tl2 where tl2.match = tl.match) total_goals FROM `wd_timeline` tl group by tl.match , tl.team) t) t group by t.team) t ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.09.2013, 22:53:42 |
|
||
|
How to find overall point of each team from result
|
|||
|---|---|---|---|
|
#18+
Более аккуратном форме :) я новичок в форуме надеюсь вы поймете меня Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.09.2013, 23:01:26 |
|
||
|
|

start [/forum/topic.php?fid=47&msg=38406528&tid=1835981]: |
0ms |
get settings: |
10ms |
get forum list: |
17ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
43ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
54ms |
get tp. blocked users: |
1ms |
| others: | 241ms |
| total: | 383ms |

| 0 / 0 |
