1
38.33 ms
SELECT
*
FROM
customer_device
WHERE
:token LIKE CONCAT (token , '%' ) AND
`status` = 0
Parameters :
[
"token " => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3MzA4MzIzOTYsImV4cCI6MTczMDgzNTk5Niwicm9sZXMiOlsiUk9MRV9DVVNUT01FUiJdLCJ1c2VybmFtZSI6ImRhbnkubGxhbmVzQGljbG91ZC5jb20ifQ.p4xjNpDsfBRDu3HLgSVi2UI3RyHomp-7o-dUrnKEqDauhaxFWpiafG_2dPf5xH_itHROAc-wDHmExYc7ghiNzg8OXdUYIqWxa8GlVM34kYpV7zGblE-TumoxxQc42CeJn1WS2h9r3pfj9Yywa-iEfVuc7eErOyKqPjdBOTXEB_rsZOWYqtBl_Ldt_klcdlVlwbNaAiJuDPR8lFNL37bSD3U6BDgLUhv5eLf7lt0u8I6BHiGpZduMtIbTlAOi03fB-nwcM0FjuxBfJjBrxmdo6jUZ5QSkYgq7IAdezVmv8GqkLvTh0WRVpXWP_lDZsVP1R5p7WgXC6vD-2cW1PUyzyvcPaI_mddarwMPWotD-pgpuXLp1_17hGNesydo1ocHYnVxsOdjj2TceH4Fap4UiVnxYuh_MnoPGjtZFdOxjAFPxj1kuQmzkAUYr1q_obZMA-tvwoUBLd4LFuj7PBiY_rbaoAciQ3OueVXhBakULDR3sW4nMp6bm6Fg1ufzWkjM8San0ddqSFr7MRrfXnFk_X97St5dLopMnryhbie-lLjb8G1ezmynuHT0Z0aT-oXWR8pTSDGUcS9lX2OTg4GgLfDbD18HSfztxvm9r7kZe0h8yug5CHFnyLGaVBKmowkvKk3sR30YSRaOtIParV3Mvj5pPmcwJeeEeCNXNPj5EMc4 "
]
SELECT
*
FROM
customer_device
WHERE
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3MzA4MzIzOTYsImV4cCI6MTczMDgzNTk5Niwicm9sZXMiOlsiUk9MRV9DVVNUT01FUiJdLCJ1c2VybmFtZSI6ImRhbnkubGxhbmVzQGljbG91ZC5jb20ifQ.p4xjNpDsfBRDu3HLgSVi2UI3RyHomp-7o-dUrnKEqDauhaxFWpiafG_2dPf5xH_itHROAc-wDHmExYc7ghiNzg8OXdUYIqWxa8GlVM34kYpV7zGblE-TumoxxQc42CeJn1WS2h9r3pfj9Yywa-iEfVuc7eErOyKqPjdBOTXEB_rsZOWYqtBl_Ldt_klcdlVlwbNaAiJuDPR8lFNL37bSD3U6BDgLUhv5eLf7lt0u8I6BHiGpZduMtIbTlAOi03fB-nwcM0FjuxBfJjBrxmdo6jUZ5QSkYgq7IAdezVmv8GqkLvTh0WRVpXWP_lDZsVP1R5p7WgXC6vD-2cW1PUyzyvcPaI_mddarwMPWotD-pgpuXLp1_17hGNesydo1ocHYnVxsOdjj2TceH4Fap4UiVnxYuh_MnoPGjtZFdOxjAFPxj1kuQmzkAUYr1q_obZMA-tvwoUBLd4LFuj7PBiY_rbaoAciQ3OueVXhBakULDR3sW4nMp6bm6Fg1ufzWkjM8San0ddqSFr7MRrfXnFk_X97St5dLopMnryhbie-lLjb8G1ezmynuHT0Z0aT-oXWR8pTSDGUcS9lX2OTg4GgLfDbD18HSfztxvm9r7kZe0h8yug5CHFnyLGaVBKmowkvKk3sR30YSRaOtIParV3Mvj5pPmcwJeeEeCNXNPj5EMc4' LIKE CONCAT (token , '%' ) AND
`status` = 0
;
Copy
2
1.38 ms
SELECT t0 . id AS id_1 , t0 . email AS email_2 , t0 . username AS username_3 , t0 . roles AS roles_4 , t0 . password AS password_5 , t0 . plain_password AS plain_password_6 , t0 . enabled AS enabled_7 , t0 . name AS name_8 , t0 . surname AS surname_9 , t0 . address AS address_10 , t0 . celular AS celular_11 , t0 . image AS image_12 , t0 . created_at AS created_at_13 , t0 . updated_at AS updated_at_14 , t0 . country_id AS country_id_15 , t0 . season_active AS season_active_16 , t0 . type_account AS type_account_17 , t0 . is_pro AS is_pro_18 , t0 . purchase AS purchase_19 , t0 . purchase_platform AS purchase_platform_20 , t0 . membership_id AS membership_id_21 , t0 . coupon_status AS coupon_status_22 , t0 . phone AS phone_23 , t0 . google_auth_code AS google_auth_code_24 , t0 . google_auth_code_verified AS google_auth_code_verified_25 , t0 . date_of_birth AS date_of_birth_26 , t0 . deleted_at AS deleted_at_27 , t0 . is_deleted AS is_deleted_28 , t0 . country_id AS country_id_29 FROM customer t0 WHERE t0 . email = ? LIMIT 1
Parameters :
[
"dany.llanes@icloud.com "
]
SELECT t0 . id AS id_1 , t0 . email AS email_2 , t0 . username AS username_3 , t0 . roles AS roles_4 , t0 . password AS password_5 , t0 . plain_password AS plain_password_6 , t0 . enabled AS enabled_7 , t0 . name AS name_8 , t0 . surname AS surname_9 , t0 . address AS address_10 , t0 . celular AS celular_11 , t0 . image AS image_12 , t0 . created_at AS created_at_13 , t0 . updated_at AS updated_at_14 , t0 . country_id AS country_id_15 , t0 . season_active AS season_active_16 , t0 . type_account AS type_account_17 , t0 . is_pro AS is_pro_18 , t0 . purchase AS purchase_19 , t0 . purchase_platform AS purchase_platform_20 , t0 . membership_id AS membership_id_21 , t0 . coupon_status AS coupon_status_22 , t0 . phone AS phone_23 , t0 . google_auth_code AS google_auth_code_24 , t0 . google_auth_code_verified AS google_auth_code_verified_25 , t0 . date_of_birth AS date_of_birth_26 , t0 . deleted_at AS deleted_at_27 , t0 . is_deleted AS is_deleted_28 , t0 . country_id AS country_id_29 FROM customer t0 WHERE t0 . email = 'dany.llanes@icloud.com' LIMIT 1 ;
Copy
3
2.27 ms
SELECT t0 . id AS id_1 , t0 . year AS year_2 , t0 . is_active AS is_active_3 , t0 . team_id AS team_id_4 , t0 . customer_id AS customer_id_5 , t0 . country_id AS country_id_6 FROM season t0 WHERE t0 . customer_id = ?
SELECT t0 . id AS id_1 , t0 . year AS year_2 , t0 . is_active AS is_active_3 , t0 . team_id AS team_id_4 , t0 . customer_id AS customer_id_5 , t0 . country_id AS country_id_6 FROM season t0 WHERE t0 . customer_id = 26554 ;
Copy
4
0.76 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? ORDER BY t0 . dorsal ASC
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 ORDER BY t0 . dorsal ASC ;
Copy
5
0.94 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122988 ;
Copy
6
0.61 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122988
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122988 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
7
0.67 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126195 ORDER BY t0 . date ASC ;
Copy
8
0.91 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 3 ;
Copy
9
1.49 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 3 ;
Copy
10
2.42 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122988
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122988 LIMIT 1 ;
Copy
11
4.13 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
12
1.21 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
13
4.40 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122988
"seasonplayer_id " => 126195
"season_id " => 27829
"alignment " => "%"id":122988% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122988 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126195
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122988%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
14
1.74 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122988
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122988
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
15
0.98 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122988
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122988 LIMIT 1 ;
Copy
16
1.30 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122988
"seasonplayer_id " => 126195
"season_id " => 27829
"alignment " => "%"id":122988% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122988 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126195
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122988%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
17
1.68 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122988 ;
Copy
18
1.51 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122988
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122988 LIMIT 1 ;
Copy
19
0.68 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
20
0.54 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
21
2.78 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122988
"seasonplayer_id " => 126195
"season_id " => 27829
"alignment " => "%"id":122988% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122988 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126195
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122988%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
22
2.03 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . image AS image_3 , t0 . image_trainer AS image_trainer_4 , t0 . updated_at AS updated_at_5 , t0 . category AS category_6 , t0 . monthly_cost AS monthly_cost_7 , t0 . kit_payment_cost AS kit_payment_cost_8 , t0 . other_payment_cost AS other_payment_cost_9 , t0 . stadium_name AS stadium_name_10 , t0 . number_clubes_league AS number_clubes_league_11 , t0 . type_soccer_id AS type_soccer_id_12 , t0 . alignment_default_u7_id AS alignment_default_u7_id_13 , t0 . alignment_default_u8_id AS alignment_default_u8_id_14 , t0 . alignment_default_u11_id AS alignment_default_u11_id_15 FROM team t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . image AS image_3 , t0 . image_trainer AS image_trainer_4 , t0 . updated_at AS updated_at_5 , t0 . category AS category_6 , t0 . monthly_cost AS monthly_cost_7 , t0 . kit_payment_cost AS kit_payment_cost_8 , t0 . other_payment_cost AS other_payment_cost_9 , t0 . stadium_name AS stadium_name_10 , t0 . number_clubes_league AS number_clubes_league_11 , t0 . type_soccer_id AS type_soccer_id_12 , t0 . alignment_default_u7_id AS alignment_default_u7_id_13 , t0 . alignment_default_u8_id AS alignment_default_u8_id_14 , t0 . alignment_default_u11_id AS alignment_default_u11_id_15 FROM team t0 WHERE t0 . id = 26656 ;
Copy
23
2.41 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122989 ;
Copy
24
1.56 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122989
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122989 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
25
0.78 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126196 ORDER BY t0 . date ASC ;
Copy
26
0.57 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 5 ;
Copy
27
0.61 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 5 ;
Copy
28
0.56 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 6 ;
Copy
29
0.67 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 6 ;
Copy
30
0.69 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122989
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122989 LIMIT 1 ;
Copy
31
0.47 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
32
0.97 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
33
3.04 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122989
"seasonplayer_id " => 126196
"season_id " => 27829
"alignment " => "%"id":122989% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122989 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126196
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122989%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
34
0.77 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122989
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122989
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
35
0.68 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122989
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122989 LIMIT 1 ;
Copy
36
1.20 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122989
"seasonplayer_id " => 126196
"season_id " => 27829
"alignment " => "%"id":122989% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122989 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126196
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122989%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
37
0.61 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122989 ;
Copy
38
0.60 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122989
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122989 LIMIT 1 ;
Copy
39
0.49 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
40
0.51 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
41
2.11 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122989
"seasonplayer_id " => 126196
"season_id " => 27829
"alignment " => "%"id":122989% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122989 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126196
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122989%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
42
0.82 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122990 ;
Copy
43
0.73 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122990
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122990 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
44
0.71 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126197 ORDER BY t0 . date ASC ;
Copy
45
0.56 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 4 ;
Copy
46
1.37 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 4 ;
Copy
47
0.66 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122990
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122990 LIMIT 1 ;
Copy
48
0.54 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
49
0.71 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
50
2.62 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122990
"seasonplayer_id " => 126197
"season_id " => 27829
"alignment " => "%"id":122990% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122990 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126197
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122990%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
51
1.20 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122990
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122990
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
52
0.42 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122990
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122990 LIMIT 1 ;
Copy
53
0.68 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122990
"seasonplayer_id " => 126197
"season_id " => 27829
"alignment " => "%"id":122990% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122990 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126197
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122990%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
54
0.33 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122990 ;
Copy
55
0.31 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122990
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122990 LIMIT 1 ;
Copy
56
1.40 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
57
0.42 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
58
1.36 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122990
"seasonplayer_id " => 126197
"season_id " => 27829
"alignment " => "%"id":122990% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122990 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126197
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122990%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
59
2.37 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122991 ;
Copy
60
2.09 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122991
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122991 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
61
0.80 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126198 ORDER BY t0 . date ASC ;
Copy
62
0.47 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122991
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122991 LIMIT 1 ;
Copy
63
0.41 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
64
1.70 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
65
1.95 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122991
"seasonplayer_id " => 126198
"season_id " => 27829
"alignment " => "%"id":122991% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122991 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126198
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122991%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
66
0.78 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122991
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122991
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
67
1.14 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122991
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122991 LIMIT 1 ;
Copy
68
1.35 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122991
"seasonplayer_id " => 126198
"season_id " => 27829
"alignment " => "%"id":122991% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122991 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126198
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122991%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
69
0.60 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122991 ;
Copy
70
0.72 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122991
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122991 LIMIT 1 ;
Copy
71
0.61 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
72
0.46 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
73
1.83 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122991
"seasonplayer_id " => 126198
"season_id " => 27829
"alignment " => "%"id":122991% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122991 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126198
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122991%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
74
0.84 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122992 ;
Copy
75
0.59 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122992
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122992 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
76
0.53 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126199 ORDER BY t0 . date ASC ;
Copy
77
0.52 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122992
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122992 LIMIT 1 ;
Copy
78
0.41 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
79
0.37 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
80
2.05 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122992
"seasonplayer_id " => 126199
"season_id " => 27829
"alignment " => "%"id":122992% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122992 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126199
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122992%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
81
0.72 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122992
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122992
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
82
0.79 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122992
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122992 LIMIT 1 ;
Copy
83
0.86 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122992
"seasonplayer_id " => 126199
"season_id " => 27829
"alignment " => "%"id":122992% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122992 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126199
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122992%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
84
0.43 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122992 ;
Copy
85
0.45 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122992
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122992 LIMIT 1 ;
Copy
86
0.82 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
87
0.38 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
88
2.51 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122992
"seasonplayer_id " => 126199
"season_id " => 27829
"alignment " => "%"id":122992% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122992 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126199
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122992%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
89
1.31 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122993 ;
Copy
90
1.68 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122993
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122993 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
91
0.61 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126200 ORDER BY t0 . date ASC ;
Copy
92
0.69 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122993
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122993 LIMIT 1 ;
Copy
93
2.32 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
94
0.41 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
95
3.02 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122993
"seasonplayer_id " => 126200
"season_id " => 27829
"alignment " => "%"id":122993% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122993 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126200
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122993%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
96
0.63 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122993
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122993
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
97
0.74 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122993
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122993 LIMIT 1 ;
Copy
98
1.21 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122993
"seasonplayer_id " => 126200
"season_id " => 27829
"alignment " => "%"id":122993% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122993 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126200
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122993%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
99
2.02 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122993 ;
Copy
100
0.59 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122993
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122993 LIMIT 1 ;
Copy
101
1.09 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
102
0.58 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
103
4.26 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122993
"seasonplayer_id " => 126200
"season_id " => 27829
"alignment " => "%"id":122993% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122993 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126200
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122993%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
104
1.31 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122994 ;
Copy
105
1.30 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122994
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122994 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
106
0.74 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126201 ORDER BY t0 . date ASC ;
Copy
107
1.80 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 2 ;
Copy
108
0.87 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 2 ;
Copy
109
2.88 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122994
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122994 LIMIT 1 ;
Copy
110
0.46 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
111
0.59 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
112
5.63 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122994
"seasonplayer_id " => 126201
"season_id " => 27829
"alignment " => "%"id":122994% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122994 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126201
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122994%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
113
2.73 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122994
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122994
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
114
0.63 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122994
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122994 LIMIT 1 ;
Copy
115
2.37 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122994
"seasonplayer_id " => 126201
"season_id " => 27829
"alignment " => "%"id":122994% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122994 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126201
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122994%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
116
0.51 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122994 ;
Copy
117
1.92 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122994
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122994 LIMIT 1 ;
Copy
118
0.53 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
119
1.82 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
120
2.71 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122994
"seasonplayer_id " => 126201
"season_id " => 27829
"alignment " => "%"id":122994% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122994 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126201
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122994%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
121
0.89 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122995 ;
Copy
122
1.14 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122995
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122995 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
123
2.06 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126202 ORDER BY t0 . date ASC ;
Copy
124
6.82 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122995
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122995 LIMIT 1 ;
Copy
125
5.40 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
126
1.78 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
127
5.65 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122995
"seasonplayer_id " => 126202
"season_id " => 27829
"alignment " => "%"id":122995% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122995 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126202
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122995%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
128
1.55 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122995
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122995
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
129
2.43 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122995
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122995 LIMIT 1 ;
Copy
130
1.37 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122995
"seasonplayer_id " => 126202
"season_id " => 27829
"alignment " => "%"id":122995% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122995 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126202
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122995%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
131
0.88 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122995 ;
Copy
132
2.59 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122995
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122995 LIMIT 1 ;
Copy
133
0.81 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
134
3.89 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
135
3.98 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122995
"seasonplayer_id " => 126202
"season_id " => 27829
"alignment " => "%"id":122995% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122995 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126202
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122995%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
136
3.50 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122996 ;
Copy
137
4.31 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122996
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122996 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
138
3.72 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126203 ORDER BY t0 . date ASC ;
Copy
139
3.50 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122996
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122996 LIMIT 1 ;
Copy
140
4.84 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
141
2.59 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
142
3.02 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122996
"seasonplayer_id " => 126203
"season_id " => 27829
"alignment " => "%"id":122996% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122996 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126203
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122996%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
143
2.63 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122996
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122996
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
144
2.84 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122996
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122996 LIMIT 1 ;
Copy
145
1.81 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122996
"seasonplayer_id " => 126203
"season_id " => 27829
"alignment " => "%"id":122996% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122996 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126203
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122996%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
146
3.29 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122996 ;
Copy
147
0.83 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122996
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122996 LIMIT 1 ;
Copy
148
2.30 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
149
5.32 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
150
4.05 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122996
"seasonplayer_id " => 126203
"season_id " => 27829
"alignment " => "%"id":122996% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122996 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126203
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122996%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
151
2.96 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122997 ;
Copy
152
3.80 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122997
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122997 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
153
10.64 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126204 ORDER BY t0 . date ASC ;
Copy
154
16.06 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122997
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122997 LIMIT 1 ;
Copy
155
4.79 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
156
2.28 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
157
4.28 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122997
"seasonplayer_id " => 126204
"season_id " => 27829
"alignment " => "%"id":122997% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122997 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126204
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122997%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
158
2.76 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122997
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122997
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
159
0.87 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122997
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122997 LIMIT 1 ;
Copy
160
2.90 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122997
"seasonplayer_id " => 126204
"season_id " => 27829
"alignment " => "%"id":122997% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122997 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126204
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122997%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
161
3.83 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122997 ;
Copy
162
1.79 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122997
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122997 LIMIT 1 ;
Copy
163
3.78 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
164
0.75 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
165
3.80 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122997
"seasonplayer_id " => 126204
"season_id " => 27829
"alignment " => "%"id":122997% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122997 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126204
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122997%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
166
3.65 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122998 ;
Copy
167
5.54 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122998
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122998 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
168
3.87 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126205 ORDER BY t0 . date ASC ;
Copy
169
3.75 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122998
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122998 LIMIT 1 ;
Copy
170
4.63 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
171
2.59 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
172
4.93 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122998
"seasonplayer_id " => 126205
"season_id " => 27829
"alignment " => "%"id":122998% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122998 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126205
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122998%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
173
1.69 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122998
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122998
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
174
6.16 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122998
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122998 LIMIT 1 ;
Copy
175
3.60 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122998
"seasonplayer_id " => 126205
"season_id " => 27829
"alignment " => "%"id":122998% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122998 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126205
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122998%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
176
3.05 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122998 ;
Copy
177
4.54 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122998
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122998 LIMIT 1 ;
Copy
178
3.83 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
179
3.75 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
180
3.43 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122998
"seasonplayer_id " => 126205
"season_id " => 27829
"alignment " => "%"id":122998% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122998 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126205
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122998%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
181
5.08 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122999 ;
Copy
182
3.59 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122999
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122999 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
183
4.80 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126206 ORDER BY t0 . date ASC ;
Copy
184
4.34 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122999
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122999 LIMIT 1 ;
Copy
185
3.28 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
186
0.80 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
187
6.70 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122999
"seasonplayer_id " => 126206
"season_id " => 27829
"alignment " => "%"id":122999% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122999 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126206
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122999%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
188
3.76 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122999
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 122999
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
189
1.70 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122999
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122999 LIMIT 1 ;
Copy
190
3.60 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122999
"seasonplayer_id " => 126206
"season_id " => 27829
"alignment " => "%"id":122999% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122999 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126206
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122999%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
191
1.18 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122999 ;
Copy
192
7.87 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
122999
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 122999 LIMIT 1 ;
Copy
193
1.04 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
194
1.74 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
195
3.25 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122999
"seasonplayer_id " => 126206
"season_id " => 27829
"alignment " => "%"id":122999% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 122999 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126206
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122999%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
196
2.62 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123000 ;
Copy
197
2.99 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123000
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123000 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
198
3.89 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126207 ORDER BY t0 . date ASC ;
Copy
199
4.69 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 7 ;
Copy
200
1.63 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 7 ;
Copy
201
1.35 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
123000
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 123000 LIMIT 1 ;
Copy
202
2.91 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
203
5.11 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
204
3.31 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123000
"seasonplayer_id " => 126207
"season_id " => 27829
"alignment " => "%"id":123000% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 123000 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126207
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123000%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
205
0.77 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 123000
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 123000
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
206
3.89 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
123000
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 123000 LIMIT 1 ;
Copy
207
3.03 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 123000
"seasonplayer_id " => 126207
"season_id " => 27829
"alignment " => "%"id":123000% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 123000 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126207
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123000%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
208
0.65 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123000 ;
Copy
209
0.56 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
123000
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 123000 LIMIT 1 ;
Copy
210
1.51 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
211
2.80 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
212
4.01 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123000
"seasonplayer_id " => 126207
"season_id " => 27829
"alignment " => "%"id":123000% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 123000 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126207
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123000%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
213
1.90 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123001 ;
Copy
214
1.75 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123001
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123001 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
215
2.58 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126208 ORDER BY t0 . date ASC ;
Copy
216
5.42 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
123001
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 123001 LIMIT 1 ;
Copy
217
0.64 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
218
2.68 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
219
5.47 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123001
"seasonplayer_id " => 126208
"season_id " => 27829
"alignment " => "%"id":123001% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 123001 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126208
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123001%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
220
3.07 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 123001
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 123001
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
221
1.50 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
123001
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 123001 LIMIT 1 ;
Copy
222
2.23 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 123001
"seasonplayer_id " => 126208
"season_id " => 27829
"alignment " => "%"id":123001% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 123001 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126208
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123001%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
223
2.99 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123001 ;
Copy
224
4.32 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
123001
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 123001 LIMIT 1 ;
Copy
225
3.68 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
226
5.42 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
227
3.85 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123001
"seasonplayer_id " => 126208
"season_id " => 27829
"alignment " => "%"id":123001% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 123001 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126208
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123001%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
228
0.73 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123002 ;
Copy
229
2.33 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123002
27829
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123002 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
230
0.65 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126209 ORDER BY t0 . date ASC ;
Copy
231
2.26 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
123002
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 123002 LIMIT 1 ;
Copy
232
4.49 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
233
0.75 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
234
2.46 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123002
"seasonplayer_id " => 126209
"season_id " => 27829
"alignment " => "%"id":123002% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 123002 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126209
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123002%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
235
2.89 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 123002
"season_id " => 27829
]
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = 123002
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
236
0.97 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
123002
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 123002 LIMIT 1 ;
Copy
237
3.72 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 123002
"seasonplayer_id " => 126209
"season_id " => 27829
"alignment " => "%"id":123002% "
]
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 123002 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126209
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123002%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
238
2.12 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123002 ;
Copy
239
3.95 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27829
123002
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27829 AND t0 . player_id = 123002 LIMIT 1 ;
Copy
240
2.86 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
241
0.99 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
242
4.34 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123002
"seasonplayer_id " => 126209
"season_id " => 27829
"alignment " => "%"id":123002% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id
AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Copy
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = 123002 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126209
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123002%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy