1
30.52 ms
SELECT
*
FROM
customer_device
WHERE
:token LIKE CONCAT (token , '%' ) AND
`status` = 0
Parameters :
[
"token " => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3MzA5MjAwNDIsImV4cCI6MTczMDkyMzY0Miwicm9sZXMiOlsiUk9MRV9DVVNUT01FUiJdLCJ1c2VybmFtZSI6ImNyaXN0aWFuYmFycm9zbWFydGluZXpAZ21haWwuY29tIn0.XHGQ73gKHb0PeeWyt3cSL1XjZ9pkMPdP8s9IfJO7PBhtlYshOB6P-jQ-cxa2FJ0y_DCe4S5uctULPrHgzionEOFCsR4Ct9ZTy4FXlC_eP3SXfsOcgX6xsCSGoSb52AANLTMbdmXed2CJmOt_5PLzTWpWw_6PMJXtR7CZk7fLtR1Mv4ZCMhUjw9-AbZA6ysd94kq_1tFLXmvfiPFr_5eW4U_ykrf2K_isfA5-hwqW92-IvSQgeadFPKtUG5OAz26ciHtUoyBeefN_RkBZgUWE4O82dV56lLV7anY5gSzv_Zu5AwCs_iZ-wAso7j7GoEwmhFI4v9I3LuC-8P4JNc-7efdpTBzkrt-hvutybvbdU4dE53FBLx9nYv2Cc_c2UHHej92teEb9jKKsRb6lfvQRFd3znMTt-uarmv5ZJaRYNWOVrus7D3Kh8zdV2um-Wu5QkxeOvrG845rskVrEU1WtXN31mjDp1zTppHOV319RbyM0x80DnB0TrbG0yY4TufKSSaACUIhth2e3KSnzRoybPkMSF5fogBBHrAfNBxVDffJkmTKdZMsJIj4MrdZK7T0sdiJW11Us3TpZFb2gXUAqdOCYnidNc0E1IOKNtxYhl9UEOrO9ChEAppwjtcuIGyk_3HD4SwmkMMmSPKCZ_AUOGlkpl9ETcenK6EQAnHKQrRU "
]
SELECT
*
FROM
customer_device
WHERE
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3MzA5MjAwNDIsImV4cCI6MTczMDkyMzY0Miwicm9sZXMiOlsiUk9MRV9DVVNUT01FUiJdLCJ1c2VybmFtZSI6ImNyaXN0aWFuYmFycm9zbWFydGluZXpAZ21haWwuY29tIn0.XHGQ73gKHb0PeeWyt3cSL1XjZ9pkMPdP8s9IfJO7PBhtlYshOB6P-jQ-cxa2FJ0y_DCe4S5uctULPrHgzionEOFCsR4Ct9ZTy4FXlC_eP3SXfsOcgX6xsCSGoSb52AANLTMbdmXed2CJmOt_5PLzTWpWw_6PMJXtR7CZk7fLtR1Mv4ZCMhUjw9-AbZA6ysd94kq_1tFLXmvfiPFr_5eW4U_ykrf2K_isfA5-hwqW92-IvSQgeadFPKtUG5OAz26ciHtUoyBeefN_RkBZgUWE4O82dV56lLV7anY5gSzv_Zu5AwCs_iZ-wAso7j7GoEwmhFI4v9I3LuC-8P4JNc-7efdpTBzkrt-hvutybvbdU4dE53FBLx9nYv2Cc_c2UHHej92teEb9jKKsRb6lfvQRFd3znMTt-uarmv5ZJaRYNWOVrus7D3Kh8zdV2um-Wu5QkxeOvrG845rskVrEU1WtXN31mjDp1zTppHOV319RbyM0x80DnB0TrbG0yY4TufKSSaACUIhth2e3KSnzRoybPkMSF5fogBBHrAfNBxVDffJkmTKdZMsJIj4MrdZK7T0sdiJW11Us3TpZFb2gXUAqdOCYnidNc0E1IOKNtxYhl9UEOrO9ChEAppwjtcuIGyk_3HD4SwmkMMmSPKCZ_AUOGlkpl9ETcenK6EQAnHKQrRU' LIKE CONCAT (token , '%' ) AND
`status` = 0
;
Copy
2
1.21 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 :
[
"cristianbarrosmartinez@gmail.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 = 'cristianbarrosmartinez@gmail.com' LIMIT 1 ;
Copy
3
0.74 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 = 26211 ;
Copy
4
1.11 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 = 27353 ORDER BY t0 . dorsal ASC ;
Copy
5
0.76 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 = 123059 ;
Copy
6
0.58 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 :
[
123059
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123059 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
7
0.55 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 = 126266 ORDER BY t0 . date ASC ;
Copy
8
0.46 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
9
0.54 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
10
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 :
[
27353
123059
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123059 LIMIT 1 ;
Copy
11
0.54 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
12
0.45 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
13
2.44 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 " => 123059
"seasonplayer_id " => 126266
"season_id " => 27353
"alignment " => "%"id":123059% "
]
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 = 123059 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126266
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123059%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
14
1.30 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 " => 123059
"season_id " => 27353
]
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 = 123059
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
15
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 :
[
27353
123059
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123059 LIMIT 1 ;
Copy
16
0.76 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 " => 123059
"seasonplayer_id " => 126266
"season_id " => 27353
"alignment " => "%"id":123059% "
]
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 = 123059 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126266
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123059%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
17
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 . 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 = 123059 ;
Copy
18
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 :
[
27353
123059
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123059 LIMIT 1 ;
Copy
19
0.42 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
20
0.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
21
1.70 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123059
"seasonplayer_id " => 126266
"season_id " => 27353
"alignment " => "%"id":123059% "
]
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 = 123059 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126266
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123059%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
22
0.95 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 = 26181 ;
Copy
23
1.01 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 = 123070 ;
Copy
24
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 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123070
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123070 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
25
0.48 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 = 126277 ORDER BY t0 . date ASC ;
Copy
26
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 = 4 ;
Copy
27
0.42 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
28
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 :
[
27353
123070
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123070 LIMIT 1 ;
Copy
29
0.42 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
30
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
31
1.51 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123070
"seasonplayer_id " => 126277
"season_id " => 27353
"alignment " => "%"id":123070% "
]
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 = 123070 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126277
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123070%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
32
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 " => 123070
"season_id " => 27353
]
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 = 123070
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
33
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 :
[
27353
123070
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123070 LIMIT 1 ;
Copy
34
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 " => 123070
"seasonplayer_id " => 126277
"season_id " => 27353
"alignment " => "%"id":123070% "
]
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 = 123070 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126277
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123070%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
35
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 = 123070 ;
Copy
36
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 :
[
27353
123070
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123070 LIMIT 1 ;
Copy
37
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
38
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
39
1.38 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 " => 123070
"seasonplayer_id " => 126277
"season_id " => 27353
"alignment " => "%"id":123070% "
]
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 = 123070 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126277
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123070%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
40
0.45 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 = 123069 ;
Copy
41
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 :
[
123069
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123069 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
42
0.38 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 = 126276 ORDER BY t0 . date ASC ;
Copy
43
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 = 6 ;
Copy
44
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 = 6 ;
Copy
45
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 :
[
27353
123069
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123069 LIMIT 1 ;
Copy
46
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
47
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
48
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 " => 123069
"seasonplayer_id " => 126276
"season_id " => 27353
"alignment " => "%"id":123069% "
]
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 = 123069 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126276
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123069%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
49
0.79 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 " => 123069
"season_id " => 27353
]
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 = 123069
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
50
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 :
[
27353
123069
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123069 LIMIT 1 ;
Copy
51
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 " => 123069
"seasonplayer_id " => 126276
"season_id " => 27353
"alignment " => "%"id":123069% "
]
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 = 123069 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126276
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123069%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
52
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 . 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 = 123069 ;
Copy
53
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 :
[
27353
123069
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123069 LIMIT 1 ;
Copy
54
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
55
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
56
2.23 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 " => 123069
"seasonplayer_id " => 126276
"season_id " => 27353
"alignment " => "%"id":123069% "
]
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 = 123069 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126276
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123069%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
57
0.43 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 = 123068 ;
Copy
58
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 :
[
123068
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123068 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
59
0.38 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 = 126275 ORDER BY t0 . date ASC ;
Copy
60
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 :
[
27353
123068
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123068 LIMIT 1 ;
Copy
61
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
62
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
63
1.96 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 " => 123068
"seasonplayer_id " => 126275
"season_id " => 27353
"alignment " => "%"id":123068% "
]
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 = 123068 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126275
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123068%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
64
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 " => 123068
"season_id " => 27353
]
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 = 123068
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
65
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 :
[
27353
123068
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123068 LIMIT 1 ;
Copy
66
0.58 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 " => 123068
"seasonplayer_id " => 126275
"season_id " => 27353
"alignment " => "%"id":123068% "
]
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 = 123068 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126275
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123068%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
67
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 = 123068 ;
Copy
68
0.29 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27353
123068
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123068 LIMIT 1 ;
Copy
69
0.21 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.18 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
1.38 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 " => 123068
"seasonplayer_id " => 126275
"season_id " => 27353
"alignment " => "%"id":123068% "
]
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 = 123068 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126275
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123068%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
72
0.43 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 = 123067 ;
Copy
73
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 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123067
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123067 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
74
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 = 126274 ORDER BY t0 . date ASC ;
Copy
75
0.31 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27353
123067
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123067 LIMIT 1 ;
Copy
76
0.22 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.16 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
1.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 " => 123067
"seasonplayer_id " => 126274
"season_id " => 27353
"alignment " => "%"id":123067% "
]
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 = 123067 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126274
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123067%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
79
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 " => 123067
"season_id " => 27353
]
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 = 123067
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
80
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 :
[
27353
123067
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123067 LIMIT 1 ;
Copy
81
0.54 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 " => 123067
"seasonplayer_id " => 126274
"season_id " => 27353
"alignment " => "%"id":123067% "
]
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 = 123067 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126274
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123067%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
82
0.27 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 = 123067 ;
Copy
83
0.24 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 :
[
27353
123067
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123067 LIMIT 1 ;
Copy
84
0.21 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.17 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
1.23 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 " => 123067
"seasonplayer_id " => 126274
"season_id " => 27353
"alignment " => "%"id":123067% "
]
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 = 123067 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126274
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123067%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
87
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 = 123066 ;
Copy
88
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 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123066
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123066 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
89
0.33 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 = 126273 ORDER BY t0 . date ASC ;
Copy
90
0.22 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.27 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.28 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 :
[
27353
123066
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123066 LIMIT 1 ;
Copy
93
0.21 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
94
0.20 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
95
1.33 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 " => 123066
"seasonplayer_id " => 126273
"season_id " => 27353
"alignment " => "%"id":123066% "
]
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 = 123066 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126273
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123066%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
96
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 " => 123066
"season_id " => 27353
]
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 = 123066
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
97
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 :
[
27353
123066
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123066 LIMIT 1 ;
Copy
98
0.54 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 " => 123066
"seasonplayer_id " => 126273
"season_id " => 27353
"alignment " => "%"id":123066% "
]
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 = 123066 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126273
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123066%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
99
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 = 123066 ;
Copy
100
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 :
[
27353
123066
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123066 LIMIT 1 ;
Copy
101
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
102
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
103
1.32 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 " => 123066
"seasonplayer_id " => 126273
"season_id " => 27353
"alignment " => "%"id":123066% "
]
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 = 123066 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126273
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123066%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
104
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 = 123065 ;
Copy
105
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 = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123065
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123065 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
106
0.27 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 = 126272 ORDER BY t0 . date ASC ;
Copy
107
0.29 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27353
123065
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123065 LIMIT 1 ;
Copy
108
0.21 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
109
0.16 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
110
1.31 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123065
"seasonplayer_id " => 126272
"season_id " => 27353
"alignment " => "%"id":123065% "
]
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 = 123065 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126272
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123065%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
111
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 " => 123065
"season_id " => 27353
]
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 = 123065
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
112
0.42 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27353
123065
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123065 LIMIT 1 ;
Copy
113
3.40 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 " => 123065
"seasonplayer_id " => 126272
"season_id " => 27353
"alignment " => "%"id":123065% "
]
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 = 123065 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126272
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123065%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
114
1.92 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . 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 = 123065 ;
Copy
115
0.81 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 :
[
27353
123065
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123065 LIMIT 1 ;
Copy
116
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
117
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
118
2.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 " => 123065
"seasonplayer_id " => 126272
"season_id " => 27353
"alignment " => "%"id":123065% "
]
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 = 123065 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126272
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123065%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
119
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 = 123064 ;
Copy
120
0.67 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 :
[
123064
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123064 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
121
0.56 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 = 126271 ORDER BY t0 . date ASC ;
Copy
122
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 :
[
27353
123064
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123064 LIMIT 1 ;
Copy
123
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
124
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
125
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 " => 123064
"seasonplayer_id " => 126271
"season_id " => 27353
"alignment " => "%"id":123064% "
]
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 = 123064 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126271
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123064%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
126
0.75 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 " => 123064
"season_id " => 27353
]
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 = 123064
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
127
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 :
[
27353
123064
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123064 LIMIT 1 ;
Copy
128
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 " => 123064
"seasonplayer_id " => 126271
"season_id " => 27353
"alignment " => "%"id":123064% "
]
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 = 123064 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126271
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123064%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
129
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 = 123064 ;
Copy
130
0.60 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27353
123064
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123064 LIMIT 1 ;
Copy
131
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
132
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
133
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 " => 123064
"seasonplayer_id " => 126271
"season_id " => 27353
"alignment " => "%"id":123064% "
]
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 = 123064 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126271
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123064%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
134
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 = 123063 ;
Copy
135
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 :
[
123063
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123063 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
136
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 = 126270 ORDER BY t0 . date ASC ;
Copy
137
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 :
[
27353
123063
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123063 LIMIT 1 ;
Copy
138
0.35 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
139
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
140
2.10 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 " => 123063
"seasonplayer_id " => 126270
"season_id " => 27353
"alignment " => "%"id":123063% "
]
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 = 123063 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126270
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123063%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
141
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 " => 123063
"season_id " => 27353
]
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 = 123063
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
142
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 :
[
27353
123063
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123063 LIMIT 1 ;
Copy
143
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 " => 123063
"seasonplayer_id " => 126270
"season_id " => 27353
"alignment " => "%"id":123063% "
]
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 = 123063 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126270
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123063%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
144
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 = 123063 ;
Copy
145
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 :
[
27353
123063
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123063 LIMIT 1 ;
Copy
146
0.44 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
147
0.57 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
148
8.96 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 " => 123063
"seasonplayer_id " => 126270
"season_id " => 27353
"alignment " => "%"id":123063% "
]
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 = 123063 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126270
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123063%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
149
6.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 = 123062 ;
Copy
150
6.92 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123062
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123062 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
151
5.70 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 = 126269 ORDER BY t0 . date ASC ;
Copy
152
1.45 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27353
123062
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123062 LIMIT 1 ;
Copy
153
2.80 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
154
0.57 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
155
1.85 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123062
"seasonplayer_id " => 126269
"season_id " => 27353
"alignment " => "%"id":123062% "
]
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 = 123062 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126269
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123062%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
156
0.78 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 123062
"season_id " => 27353
]
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 = 123062
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
157
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 :
[
27353
123062
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123062 LIMIT 1 ;
Copy
158
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 " => 123062
"seasonplayer_id " => 126269
"season_id " => 27353
"alignment " => "%"id":123062% "
]
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 = 123062 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126269
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123062%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
159
0.51 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123062 ;
Copy
160
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 :
[
27353
123062
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123062 LIMIT 1 ;
Copy
161
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
162
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
163
2.18 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 " => 123062
"seasonplayer_id " => 126269
"season_id " => 27353
"alignment " => "%"id":123062% "
]
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 = 123062 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126269
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123062%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
164
0.61 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 = 123061 ;
Copy
165
0.81 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 :
[
123061
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123061 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
166
0.48 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 = 126268 ORDER BY t0 . date ASC ;
Copy
167
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 :
[
27353
123061
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123061 LIMIT 1 ;
Copy
168
0.41 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
169
0.30 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
170
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 " => 123061
"seasonplayer_id " => 126268
"season_id " => 27353
"alignment " => "%"id":123061% "
]
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 = 123061 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126268
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123061%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
171
2.27 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 " => 123061
"season_id " => 27353
]
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 = 123061
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
172
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 :
[
27353
123061
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123061 LIMIT 1 ;
Copy
173
0.85 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 " => 123061
"seasonplayer_id " => 126268
"season_id " => 27353
"alignment " => "%"id":123061% "
]
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 = 123061 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126268
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123061%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
174
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 = 123061 ;
Copy
175
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 :
[
27353
123061
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123061 LIMIT 1 ;
Copy
176
0.35 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
177
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
178
2.17 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 " => 123061
"seasonplayer_id " => 126268
"season_id " => 27353
"alignment " => "%"id":123061% "
]
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 = 123061 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126268
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123061%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
179
0.56 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 = 123060 ;
Copy
180
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 :
[
123060
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123060 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
181
3.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 = 126267 ORDER BY t0 . date ASC ;
Copy
182
0.58 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 :
[
27353
123060
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123060 LIMIT 1 ;
Copy
183
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
184
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
185
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 " => 123060
"seasonplayer_id " => 126267
"season_id " => 27353
"alignment " => "%"id":123060% "
]
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 = 123060 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126267
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123060%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
186
0.75 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 " => 123060
"season_id " => 27353
]
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 = 123060
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
187
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 :
[
27353
123060
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123060 LIMIT 1 ;
Copy
188
0.78 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 " => 123060
"seasonplayer_id " => 126267
"season_id " => 27353
"alignment " => "%"id":123060% "
]
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 = 123060 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126267
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123060%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
189
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 = 123060 ;
Copy
190
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 :
[
27353
123060
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123060 LIMIT 1 ;
Copy
191
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
192
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
193
2.58 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 " => 123060
"seasonplayer_id " => 126267
"season_id " => 27353
"alignment " => "%"id":123060% "
]
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 = 123060 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126267
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123060%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
194
0.56 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 = 118690 ;
Copy
195
0.48 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 = 123058 ;
Copy
196
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 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123058
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123058 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
197
0.42 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 = 126265 ORDER BY t0 . date ASC ;
Copy
198
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 :
[
27353
123058
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123058 LIMIT 1 ;
Copy
199
0.68 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
200
0.30 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
201
2.82 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 " => 123058
"seasonplayer_id " => 126265
"season_id " => 27353
"alignment " => "%"id":123058% "
]
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 = 123058 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126265
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123058%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
202
0.62 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 " => 123058
"season_id " => 27353
]
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 = 123058
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
203
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 :
[
27353
123058
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123058 LIMIT 1 ;
Copy
204
0.83 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 " => 123058
"seasonplayer_id " => 126265
"season_id " => 27353
"alignment " => "%"id":123058% "
]
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 = 123058 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126265
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123058%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
205
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 = 123058 ;
Copy
206
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 :
[
27353
123058
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123058 LIMIT 1 ;
Copy
207
0.35 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
208
0.85 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
209
3.64 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 " => 123058
"seasonplayer_id " => 126265
"season_id " => 27353
"alignment " => "%"id":123058% "
]
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 = 123058 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126265
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123058%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
210
0.50 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123057 ;
Copy
211
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 :
[
123057
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123057 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
212
0.44 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 = 126264 ORDER BY t0 . date ASC ;
Copy
213
0.32 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
214
0.41 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
215
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 :
[
27353
123057
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123057 LIMIT 1 ;
Copy
216
1.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
217
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
218
2.49 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 " => 123057
"seasonplayer_id " => 126264
"season_id " => 27353
"alignment " => "%"id":123057% "
]
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 = 123057 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126264
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123057%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
219
0.75 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 " => 123057
"season_id " => 27353
]
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 = 123057
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
220
1.03 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 :
[
27353
123057
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123057 LIMIT 1 ;
Copy
221
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 " => 123057
"seasonplayer_id " => 126264
"season_id " => 27353
"alignment " => "%"id":123057% "
]
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 = 123057 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126264
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123057%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
222
1.07 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 = 123057 ;
Copy
223
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 :
[
27353
123057
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123057 LIMIT 1 ;
Copy
224
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
225
0.69 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
226
1.80 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123057
"seasonplayer_id " => 126264
"season_id " => 27353
"alignment " => "%"id":123057% "
]
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 = 123057 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126264
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123057%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
227
0.50 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123056 ;
Copy
228
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 = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123056
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123056 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
229
0.59 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 = 126263 ORDER BY t0 . date ASC ;
Copy
230
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 :
[
27353
123056
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123056 LIMIT 1 ;
Copy
231
11.05 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
232
13.48 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
233
6.79 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 " => 123056
"seasonplayer_id " => 126263
"season_id " => 27353
"alignment " => "%"id":123056% "
]
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 = 123056 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126263
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123056%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
234
3.09 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 " => 123056
"season_id " => 27353
]
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 = 123056
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
235
0.71 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 :
[
27353
123056
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123056 LIMIT 1 ;
Copy
236
0.96 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 " => 123056
"seasonplayer_id " => 126263
"season_id " => 27353
"alignment " => "%"id":123056% "
]
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 = 123056 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126263
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123056%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
237
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 = 123056 ;
Copy
238
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 :
[
27353
123056
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123056 LIMIT 1 ;
Copy
239
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
240
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
241
1.49 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 " => 123056
"seasonplayer_id " => 126263
"season_id " => 27353
"alignment " => "%"id":123056% "
]
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 = 123056 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126263
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123056%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
242
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 = 123055 ;
Copy
243
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 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123055
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123055 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
244
0.42 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 = 126262 ORDER BY t0 . date ASC ;
Copy
245
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 :
[
27353
123055
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123055 LIMIT 1 ;
Copy
246
0.41 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
247
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
248
1.55 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 " => 123055
"seasonplayer_id " => 126262
"season_id " => 27353
"alignment " => "%"id":123055% "
]
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 = 123055 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126262
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123055%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
249
1.21 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 " => 123055
"season_id " => 27353
]
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 = 123055
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
250
1.17 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 :
[
27353
123055
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123055 LIMIT 1 ;
Copy
251
0.97 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 " => 123055
"seasonplayer_id " => 126262
"season_id " => 27353
"alignment " => "%"id":123055% "
]
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 = 123055 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126262
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123055%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
252
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 = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123055 ;
Copy
253
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 :
[
27353
123055
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123055 LIMIT 1 ;
Copy
254
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
255
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
256
2.16 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 " => 123055
"seasonplayer_id " => 126262
"season_id " => 27353
"alignment " => "%"id":123055% "
]
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 = 123055 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126262
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123055%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
257
0.65 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123054 ;
Copy
258
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 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123054
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123054 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
259
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 = 126261 ORDER BY t0 . date ASC ;
Copy
260
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 :
[
27353
123054
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123054 LIMIT 1 ;
Copy
261
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
262
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
263
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 " => 123054
"seasonplayer_id " => 126261
"season_id " => 27353
"alignment " => "%"id":123054% "
]
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 = 123054 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126261
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123054%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
264
0.60 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 " => 123054
"season_id " => 27353
]
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 = 123054
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
265
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 :
[
27353
123054
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123054 LIMIT 1 ;
Copy
266
1.02 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 " => 123054
"seasonplayer_id " => 126261
"season_id " => 27353
"alignment " => "%"id":123054% "
]
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 = 123054 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126261
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123054%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
267
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 = 123054 ;
Copy
268
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 :
[
27353
123054
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123054 LIMIT 1 ;
Copy
269
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
270
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
271
2.26 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123054
"seasonplayer_id " => 126261
"season_id " => 27353
"alignment " => "%"id":123054% "
]
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 = 123054 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126261
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123054%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
272
0.75 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 = 123053 ;
Copy
273
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 :
[
123053
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123053 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
274
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 = 126260 ORDER BY t0 . date ASC ;
Copy
275
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 :
[
27353
123053
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123053 LIMIT 1 ;
Copy
276
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
277
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
278
2.10 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 " => 123053
"seasonplayer_id " => 126260
"season_id " => 27353
"alignment " => "%"id":123053% "
]
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 = 123053 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126260
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123053%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
279
0.79 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 " => 123053
"season_id " => 27353
]
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 = 123053
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
280
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 :
[
27353
123053
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123053 LIMIT 1 ;
Copy
281
3.69 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 " => 123053
"seasonplayer_id " => 126260
"season_id " => 27353
"alignment " => "%"id":123053% "
]
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 = 123053 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126260
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123053%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
282
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 . 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 = 123053 ;
Copy
283
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 :
[
27353
123053
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123053 LIMIT 1 ;
Copy
284
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
285
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
286
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 " => 123053
"seasonplayer_id " => 126260
"season_id " => 27353
"alignment " => "%"id":123053% "
]
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 = 123053 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126260
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123053%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
287
0.81 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 = 123052 ;
Copy
288
0.76 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123052
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123052 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
289
0.90 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 = 126259 ORDER BY t0 . date ASC ;
Copy
290
1.12 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
291
0.93 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
292
2.86 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 :
[
27353
123052
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123052 LIMIT 1 ;
Copy
293
3.50 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
294
6.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
295
2.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 " => 123052
"seasonplayer_id " => 126259
"season_id " => 27353
"alignment " => "%"id":123052% "
]
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 = 123052 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126259
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123052%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
296
0.97 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 " => 123052
"season_id " => 27353
]
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 = 123052
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
297
0.65 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27353
123052
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123052 LIMIT 1 ;
Copy
298
0.94 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 " => 123052
"seasonplayer_id " => 126259
"season_id " => 27353
"alignment " => "%"id":123052% "
]
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 = 123052 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126259
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123052%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
299
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 = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123052 ;
Copy
300
1.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 :
[
27353
123052
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 123052 LIMIT 1 ;
Copy
301
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
302
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
303
3.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 " => 123052
"seasonplayer_id " => 126259
"season_id " => 27353
"alignment " => "%"id":123052% "
]
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 = 123052 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126259
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123052%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
304
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 = 121319 ;
Copy
305
0.81 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 = 121318 ;
Copy
306
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 :
[
121318
27353
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 121318 AND t0 . season_id = 27353 LIMIT 1 ;
Copy
307
0.52 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 = 124494 ORDER BY t0 . date ASC ;
Copy
308
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 :
[
27353
121318
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 121318 LIMIT 1 ;
Copy
309
0.83 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
310
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
311
2.21 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 " => 121318
"seasonplayer_id " => 124494
"season_id " => 27353
"alignment " => "%"id":121318% "
]
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 = 121318 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 124494
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":121318%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
312
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 " => 121318
"season_id " => 27353
]
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 = 121318
WHERE ta . season_id = 27353
GROUP BY ta . season_id ;
;
Copy
313
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 :
[
27353
121318
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 121318 LIMIT 1 ;
Copy
314
0.83 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 " => 121318
"seasonplayer_id " => 124494
"season_id " => 27353
"alignment " => "%"id":121318% "
]
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 = 121318 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 124494
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":121318%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
315
0.96 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 = 121318 ;
Copy
316
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 :
[
27353
121318
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 27353 AND t0 . player_id = 121318 LIMIT 1 ;
Copy
317
0.41 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
318
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
319
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 " => 121318
"seasonplayer_id " => 124494
"season_id " => 27353
"alignment " => "%"id":121318% "
]
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 = 121318 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 124494
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":121318%'
WHERE
g . season_id = 27353
AND g . deleted_at IS NULL
;
Copy
320
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 = 121317 ;
Copy
321
1.72 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 = 118691 ;
Copy