SELECT tournament.id
											, tournament.name
											, tournament.hash
											, game_result_composition.player_id
											, game_result_composition.team_id
											, COUNT(game.id) AS game_count
											, (SELECT COUNT(game_result_score.id) 	
												FROM game_result_score 	
													JOIN game ON game.id = game_result_score.game_id AND game.publish_results = 1
													WHERE game_result_score.team_id = game_result_composition.team_id 
														AND ((game_result_score.player_id = game_result_composition.player_id) 		
																								OR (assistent1_id = game_result_composition.player_id) 
																								OR (assistent2_id = game_result_composition.player_id))
														AND game.tournament_id = tournament.id
												) 
											AS player_point
											, (SELECT COUNT(game_result_score.id) 	
												FROM game_result_score 	
													JOIN game ON game.id = game_result_score.game_id AND game.publish_results = 1
													WHERE game_result_score.team_id = game_result_composition.team_id 
														AND game_result_score.player_id = game_result_composition.player_id
														AND game.tournament_id = tournament.id
												) 
											AS player_goal
											, (SELECT COUNT(game_result_score.id) 	
												FROM game_result_score 	
													JOIN game ON game.id = game_result_score.game_id AND game.publish_results = 1
													WHERE game_result_score.team_id = game_result_composition.team_id 
														AND ((assistent1_id = game_result_composition.player_id) 
															OR (assistent2_id = game_result_composition.player_id))
														AND game.tournament_id = tournament.id
												) 
											AS player_assistent
											, (SELECT SUM(minute) 	
												FROM game_result_penalty 	
													JOIN game ON game.id = game_result_penalty.game_id AND game.publish_results = 1
												WHERE game_result_penalty.team_id = game_result_composition.team_id 
												    AND player_id           = game_result_composition.player_id 
													AND game.tournament_id  = tournament.id
												)
											AS player_penalty
											
											 ,(
                                              SELECT SUM(game_result_plus_minus.point) 	FROM game_result_plus_minus 
                                                  JOIN game ON game.id = game_result_plus_minus.game_id AND game.publish_results = 1	
                                                WHERE team_id 		        = game_result_composition.team_id 
                                                    AND player_id 	        = game_result_composition.player_id
                                                    AND game.tournament_id  = tournament.id
                                            ) AS player_plus_minus
											
											, (SELECT SUM(shoot_1)+SUM(shoot_2)+SUM(shoot_3) 
												FROM game_result_goalkeeper 
													JOIN game ON game.id = game_result_goalkeeper.game_id AND game.publish_results = 1
												WHERE team_id = game_result_composition.team_id 
													AND game.tournament_id = tournament.id
													AND player_id = game_result_composition.player_id) 
											AS goalkeeper_shoots
											, (SELECT SUM(goals_missed) 
												FROM game_result_goalkeeper 
													JOIN game ON game.id = game_result_goalkeeper.game_id AND game.publish_results = 1
												WHERE team_id = game_result_composition.team_id 
													AND game.tournament_id = tournament.id
													AND player_id = game_result_composition.player_id) 
											AS goalkeeper_goals_missed
											, (SELECT SUM(reflected_shoots) 
												FROM game_result_goalkeeper 
													JOIN game ON game.id = game_result_goalkeeper.game_id AND game.publish_results = 1
												WHERE team_id = game_result_composition.team_id 
													AND game.tournament_id = tournament.id
													AND player_id = game_result_composition.player_id) 	
											AS goalkeeper_reflected_shoots
											, (SELECT SUM(reflected_shoots) / (SUM(shoot_1)+SUM(shoot_2)+SUM(shoot_3)) 
												FROM game_result_goalkeeper 
													JOIN game ON game.id = game_result_goalkeeper.game_id AND game.publish_results = 1
												WHERE team_id = game_result_composition.team_id 
													AND game.tournament_id = tournament.id
													AND player_id = game_result_composition.player_id) 
											AS goalkeeper_percent
											, player_request.player_position_id
										    , championship.name             AS championship_name
											FROM game_result_composition
												JOIN game 			ON game.id 				= game_result_composition.game_id AND game.publish_results = 1
												JOIN player_request ON player_request.id 	= game_result_composition.player_request_id 
												JOIN tournament 	ON tournament.id 		= game.tournament_id
											    JOIN championship   ON championship.id = tournament.championship_id
												JOIN game_series 	ON game_series.id 		= game.game_series_id
											WHERE game_result_composition.player_id = '4993'
												AND tournament.season_id 			= '8'
											GROUP BY tournament.id
											ORDER BY tournament.id DESC
										                  
                      | Сезон 2023-2024 | М | О | Ш | П | +/- | ШТ | 
                  
                          
                      |   1-й Дивизион Регулярное первенство | 9 | 5 ср.0.6
 | 3 ср.0.3
 | 2 ср.0.2
 | 0 ср.0
 | 0 ср.0
 | 
              
                                      
              | Соперники | Дата матча | О | Ш | П | +/- | ШТ | 
                              
                                  
              | Невский район - Самураи Pro | 07 декабря 2023 | 0 | 0 | 0 | 0 | 0 | 
                          
                                  
              | Самураи Pro - Альтернатива | 20 декабря 2023 | 0 | 0 | 0 | 0 | 0 | 
                          
                                  
              | Арсенал - Самураи Pro | 14 января 2024 | 1 | 1 | 0 | 0 | 0 | 
                          
                                  
              | Самураи Pro - Альтернатива | 27 марта 2024 | 0 | 0 | 0 | 0 | 0 | 
                          
                                  
              | Альтернатива - Самураи Pro | 31 марта 2024 | 2 | 1 | 1 | 0 | 0 | 
                          
                                  
              | Самураи Pro - Альтернатива | 03 апреля 2024 | 1 | 1 | 0 | 0 | 0 | 
                          
                                  
              | Альтернатива - Самураи Pro | 10 апреля 2024 | 0 | 0 | 0 | 0 | 0 | 
                          
                                  
              | Самураи Pro - Альтернатива | 13 апреля 2024 | 0 | 0 | 0 | 0 | 0 | 
                          
                                  
              | Самураи Pro - Невский район | 24 апреля 2024 | 1 | 0 | 1 | 0 | 0 |