1
31.60 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
0.93 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
0.61 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.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 = ? 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.66 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
6
0.55 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
7
0.49 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
8
0.78 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
9
4.70 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
10
0.41 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
11
0.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 = 4 ;
Copy
12
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
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
13
0.43 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
14
0.77 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
15
2.20 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
16
1.14 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
17
0.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
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
18
4.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 " => 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
19
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 . 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
20
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
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
21
0.38 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
22
0.36 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
23
2.27 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
24
0.45 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
25
0.55 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 = 123004 ;
Copy
26
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 = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123004
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 = 123004 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
27
0.43 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 = 126211 ORDER BY t0 . date ASC ;
Copy
28
0.30 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 = 1 ;
Copy
29
0.38 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 = 1 ;
Copy
30
0.48 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
123004
]
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 = 123004 LIMIT 1 ;
Copy
31
0.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
32
0.31 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
2.06 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 " => 123004
"seasonplayer_id " => 126211
"season_id " => 27829
"alignment " => "%"id":123004% "
]
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 = 123004 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126211
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123004%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
34
0.67 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 " => 123004
"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 = 123004
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
35
0.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
123004
]
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 = 123004 LIMIT 1 ;
Copy
36
0.87 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 " => 123004
"seasonplayer_id " => 126211
"season_id " => 27829
"alignment " => "%"id":123004% "
]
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 = 123004 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126211
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123004%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
37
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 . 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 = 123004 ;
Copy
38
0.38 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
123004
]
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 = 123004 LIMIT 1 ;
Copy
39
0.31 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.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
41
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 " => 123004
"seasonplayer_id " => 126211
"season_id " => 27829
"alignment " => "%"id":123004% "
]
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 = 123004 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126211
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123004%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
42
0.46 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 = 123003 ;
Copy
43
0.39 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 :
[
123003
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 = 123003 AND t0 . season_id = 27829 LIMIT 1 ;
Copy
44
0.36 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 = 126210 ORDER BY t0 . date ASC ;
Copy
45
0.38 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
123003
]
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 = 123003 LIMIT 1 ;
Copy
46
0.26 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
47
0.29 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
48
1.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 " => 123003
"seasonplayer_id " => 126210
"season_id " => 27829
"alignment " => "%"id":123003% "
]
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 = 123003 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126210
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123003%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
49
0.52 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 " => 123003
"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 = 123003
WHERE ta . season_id = 27829
GROUP BY ta . season_id ;
;
Copy
50
0.36 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
123003
]
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 = 123003 LIMIT 1 ;
Copy
51
0.67 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 " => 123003
"seasonplayer_id " => 126210
"season_id " => 27829
"alignment " => "%"id":123003% "
]
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 = 123003 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126210
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123003%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
52
0.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 . 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 = 123003 ;
Copy
53
0.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
123003
]
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 = 123003 LIMIT 1 ;
Copy
54
0.26 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
55
0.24 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
56
2.09 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 " => 123003
"seasonplayer_id " => 126210
"season_id " => 27829
"alignment " => "%"id":123003% "
]
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 = 123003 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126210
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123003%'
WHERE
g . season_id = 27829
AND g . deleted_at IS NULL
;
Copy
57
0.58 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
58
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 . 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
59
0.46 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
60
0.48 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
61
0.36 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
62
0.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
63
2.15 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
64
0.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 " => 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
65
0.49 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
66
0.82 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
67
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 . 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
68
0.46 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
69
0.38 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
70
0.33 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
71
2.20 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
72
0.52 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
73
0.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 :
[
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
74
0.47 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
75
0.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
76
0.39 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
77
0.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
78
2.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 " => 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
79
0.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 " => 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
80
0.53 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
81
0.92 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
82
0.46 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
83
0.49 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
84
0.38 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
85
0.36 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
86
2.35 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
87
0.53 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
88
0.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 . 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
89
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 = 126207 ORDER BY t0 . date ASC ;
Copy
90
0.39 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
91
0.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
92
0.36 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
93
0.46 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
94
0.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
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
95
0.38 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
96
0.35 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
97
2.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 " => 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
98
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 " => 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
99
0.57 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
100
0.91 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
101
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 . 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
102
0.49 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
103
0.39 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
104
0.33 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
105
2.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 " => 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
106
0.59 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
107
0.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 :
[
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
108
0.49 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
109
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 . 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
110
0.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
111
0.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
112
1.73 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
113
0.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 " => 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
114
0.39 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
115
0.61 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
116
0.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 . 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
117
0.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
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
118
0.26 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
0.23 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
1.81 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
121
0.40 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
122
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 = ? 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
123
0.40 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
124
0.28 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
125
0.34 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
126
0.29 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
127
0.32 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
128
0.36 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
129
0.29 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
130
0.24 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
131
1.57 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
132
0.57 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
133
0.37 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
134
0.66 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
135
0.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 . 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
136
0.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
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
137
0.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
138
0.26 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
139
1.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 " => 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
140
0.39 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
141
0.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 . 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
142
0.35 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
143
0.36 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
144
0.24 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
145
0.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
146
1.39 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
147
0.53 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
148
0.37 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
149
0.67 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
150
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 = 122997 ;
Copy
151
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 . 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
152
0.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
153
0.24 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
154
2.00 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
155
0.42 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
156
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 . 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
157
0.35 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
158
0.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
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
159
0.27 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
160
0.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
161
2.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 " => 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
162
0.61 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
163
0.48 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
164
0.79 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
165
0.37 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
166
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 . 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
167
0.74 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
168
0.34 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
169
3.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 " => 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
170
0.49 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
171
0.49 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
172
0.43 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
173
0.44 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
174
0.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
175
0.26 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
176
2.12 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
177
0.65 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
178
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
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
179
0.84 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
180
0.40 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
181
1.93 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
182
0.34 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
183
0.27 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
184
2.24 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
185
0.47 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
186
0.44 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
187
0.46 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
188
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 . 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
189
0.31 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
190
0.29 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
191
2.13 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
192
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 " => 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
193
0.46 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
194
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 " => 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
195
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 = 122994 ;
Copy
196
0.46 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
197
0.36 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
198
0.34 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
199
2.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 " => 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
200
0.57 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
201
0.55 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
202
0.49 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
203
0.49 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
204
0.36 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
205
0.33 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
206
2.08 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
207
0.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 " => 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
208
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 . 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
209
0.87 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
210
0.41 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
211
0.46 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
212
0.36 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
213
0.33 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
214
2.27 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
215
0.52 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
216
0.55 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
217
0.50 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
218
0.57 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
219
0.39 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
220
0.33 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
221
2.29 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
222
0.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 " => 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
223
0.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
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
224
0.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 " => 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
225
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 . 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
226
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
227
0.39 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
228
17.29 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
229
3.86 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
230
1.67 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
231
3.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 :
[
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
232
1.75 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
233
1.46 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
234
0.60 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
235
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
236
1.56 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
237
0.57 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
238
0.41 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
239
0.75 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
240
1.15 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
241
0.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
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
242
0.48 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
243
0.40 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
244
2.19 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
245
0.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 = 122990 ;
Copy
246
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 . 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
247
1.57 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
248
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
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
249
3.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
250
3.09 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
251
3.14 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
252
0.71 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
253
0.62 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
254
0.93 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
255
0.41 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
256
0.38 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
257
0.23 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
258
0.19 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
259
2.39 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
260
0.59 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
261
0.62 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
262
0.51 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
263
0.38 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
264
0.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
265
0.33 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
266
2.24 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
267
0.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 " => 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
268
0.49 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
269
0.91 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
270
0.46 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
271
0.55 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
272
0.37 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
273
0.33 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
274
2.35 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