1
29.64 ms
SELECT
*
FROM
customer_device
WHERE
:token LIKE CONCAT (token , '%' ) AND
`status` = 0
Parameters :
[
"token " => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3MzA4OTMwODgsImV4cCI6MTczMDg5NjY4OCwicm9sZXMiOlsiUk9MRV9DVVNUT01FUiJdLCJ1c2VybmFtZSI6ImNyb2NoYTA4ZW50cmVuYWRvcmRlZnV0Ym9sQGdtYWlsLmNvbSJ9.jxa-36DAoKsm6FvFWPeU2c98_Zt6A1mWZAFEKgi0LTNbhGpZjvnHUHdpueRipKr6q0SZKTPjMQPQxNv1LRErOWyESH2AgNjrZ5FYPAOHtaCbN6W9DzMWqdQNsr-P78C0pIJqlksfkBxRngm31N_8k5mBrY_dSAs_iHT2LQ9Wqgbs14F0C9_vDkY3rbYY74AxeKsjtRFRwkAYNfvYo-jBPY0ROiK9Cvf7njckIKRhNGZ49gZaRZ4of2AS3fikS3i_EA2a-aYvPz7fo6145uwgLt51lZIN_aNi9iUbwt_2QSp_wI6q9gv1rFpwE6dUd_odktufxX0uuIcAh3J8yMzPiII8eH27cQLkxK23xDFIRRblGxFxZPhs6FqXmixvoZNzvVYgObCFE-yj7l-TymSMgRPay6FliPA5tDy8lv1HQ55xx-YNtZE3R32aai11Zza8v0vpXvCSyYIRYckmJY7qhOZ6HC9rIsidLhWaHyv8gdLoD6Xxgylx6ZlGWWYSMxD3AY7tSsUmbO8QWYDMmvc-DK6t6gNzawwKYzQeledyoy_3axXtpWQKsJRPfvgTb3xCsdqBECtCMwbDzR-Bg3znghvcTeJsvCgjWPzeSzuj0NLASwPO7mDUshi7VQ5BwRDmxQ_4ezr5LA8PL7ZfmFmMq5szg4X1ONfaDNEcACdSQCE "
]
SELECT
*
FROM
customer_device
WHERE
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3MzA4OTMwODgsImV4cCI6MTczMDg5NjY4OCwicm9sZXMiOlsiUk9MRV9DVVNUT01FUiJdLCJ1c2VybmFtZSI6ImNyb2NoYTA4ZW50cmVuYWRvcmRlZnV0Ym9sQGdtYWlsLmNvbSJ9.jxa-36DAoKsm6FvFWPeU2c98_Zt6A1mWZAFEKgi0LTNbhGpZjvnHUHdpueRipKr6q0SZKTPjMQPQxNv1LRErOWyESH2AgNjrZ5FYPAOHtaCbN6W9DzMWqdQNsr-P78C0pIJqlksfkBxRngm31N_8k5mBrY_dSAs_iHT2LQ9Wqgbs14F0C9_vDkY3rbYY74AxeKsjtRFRwkAYNfvYo-jBPY0ROiK9Cvf7njckIKRhNGZ49gZaRZ4of2AS3fikS3i_EA2a-aYvPz7fo6145uwgLt51lZIN_aNi9iUbwt_2QSp_wI6q9gv1rFpwE6dUd_odktufxX0uuIcAh3J8yMzPiII8eH27cQLkxK23xDFIRRblGxFxZPhs6FqXmixvoZNzvVYgObCFE-yj7l-TymSMgRPay6FliPA5tDy8lv1HQ55xx-YNtZE3R32aai11Zza8v0vpXvCSyYIRYckmJY7qhOZ6HC9rIsidLhWaHyv8gdLoD6Xxgylx6ZlGWWYSMxD3AY7tSsUmbO8QWYDMmvc-DK6t6gNzawwKYzQeledyoy_3axXtpWQKsJRPfvgTb3xCsdqBECtCMwbDzR-Bg3znghvcTeJsvCgjWPzeSzuj0NLASwPO7mDUshi7VQ5BwRDmxQ_4ezr5LA8PL7ZfmFmMq5szg4X1ONfaDNEcACdSQCE' LIKE CONCAT (token , '%' ) AND
`status` = 0
;
Copy
2
1.08 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 :
[
"crocha08entrenadordefutbol@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 = 'crocha08entrenadordefutbol@gmail.com' LIMIT 1 ;
Copy
3
1.37 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 = 26308 ;
Copy
4
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 . 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 = 27491 ORDER BY t0 . dorsal ASC ;
Copy
5
0.97 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 = 119284 ;
Copy
6
0.90 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 :
[
119284
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 119284 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
7
0.93 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 = 122337 ORDER BY t0 . date ASC ;
Copy
8
0.75 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
9
0.88 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
10
0.56 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
119284
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 119284 LIMIT 1 ;
Copy
11
0.97 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.55 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
3.12 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 119284
"seasonplayer_id " => 122337
"season_id " => 27491
"alignment " => "%"id":119284% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 119284 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 122337
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":119284%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
14
1.31 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 " => 119284
"season_id " => 27491
]
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 = 119284
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
15
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 :
[
27491
119284
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 119284 LIMIT 1 ;
Copy
16
0.80 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 " => 119284
"seasonplayer_id " => 122337
"season_id " => 27491
"alignment " => "%"id":119284% "
]
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 = 119284 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 122337
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":119284%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
17
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 = 119284 ;
Copy
18
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 :
[
27491
119284
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 119284 LIMIT 1 ;
Copy
19
0.25 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.26 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
21
1.47 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 119284
"seasonplayer_id " => 122337
"season_id " => 27491
"alignment " => "%"id":119284% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 119284 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 122337
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":119284%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
22
0.71 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 = 26319 ;
Copy
23
0.42 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123041 ;
Copy
24
0.44 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123041
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123041 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
25
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 = 126248 ORDER BY t0 . date ASC ;
Copy
26
0.27 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
27
0.34 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 2 ;
Copy
28
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 :
[
27491
123041
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123041 LIMIT 1 ;
Copy
29
0.29 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
30
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
31
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 " => 123041
"seasonplayer_id " => 126248
"season_id " => 27491
"alignment " => "%"id":123041% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123041 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126248
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123041%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
32
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 " => 123041
"season_id " => 27491
]
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 = 123041
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
33
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 :
[
27491
123041
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123041 LIMIT 1 ;
Copy
34
0.68 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 123041
"seasonplayer_id " => 126248
"season_id " => 27491
"alignment " => "%"id":123041% "
]
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 = 123041 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126248
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123041%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
35
0.43 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123041 ;
Copy
36
0.45 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123041
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123041 LIMIT 1 ;
Copy
37
0.73 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.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
39
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 " => 123041
"seasonplayer_id " => 126248
"season_id " => 27491
"alignment " => "%"id":123041% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123041 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126248
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123041%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
40
2.95 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 = 123030 ;
Copy
41
4.80 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123030
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123030 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
42
0.43 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126237 ORDER BY t0 . date ASC ;
Copy
43
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 :
[
27491
123030
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123030 LIMIT 1 ;
Copy
44
0.40 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
45
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
46
2.77 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 " => 123030
"seasonplayer_id " => 126237
"season_id " => 27491
"alignment " => "%"id":123030% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123030 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126237
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123030%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
47
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 " => 123030
"season_id " => 27491
]
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 = 123030
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
48
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 :
[
27491
123030
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123030 LIMIT 1 ;
Copy
49
0.79 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 123030
"seasonplayer_id " => 126237
"season_id " => 27491
"alignment " => "%"id":123030% "
]
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 = 123030 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126237
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123030%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
50
0.40 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123030 ;
Copy
51
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 :
[
27491
123030
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123030 LIMIT 1 ;
Copy
52
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
53
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
54
4.01 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123030
"seasonplayer_id " => 126237
"season_id " => 27491
"alignment " => "%"id":123030% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123030 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126237
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123030%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
55
1.86 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 = 123034 ;
Copy
56
0.62 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123034
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123034 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
57
0.58 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126241 ORDER BY t0 . date ASC ;
Copy
58
0.36 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 5 ;
Copy
59
0.44 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
60
0.46 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123034
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123034 LIMIT 1 ;
Copy
61
0.34 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
62
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
63
2.39 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123034
"seasonplayer_id " => 126241
"season_id " => 27491
"alignment " => "%"id":123034% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123034 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126241
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123034%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
64
1.66 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 " => 123034
"season_id " => 27491
]
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 = 123034
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
65
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 :
[
27491
123034
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123034 LIMIT 1 ;
Copy
66
0.73 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 " => 123034
"seasonplayer_id " => 126241
"season_id " => 27491
"alignment " => "%"id":123034% "
]
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 = 123034 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126241
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123034%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
67
0.43 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123034 ;
Copy
68
1.19 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_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 :
[
27491
123034
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123034 LIMIT 1 ;
Copy
69
0.69 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.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
71
15.65 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123034
"seasonplayer_id " => 126241
"season_id " => 27491
"alignment " => "%"id":123034% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123034 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126241
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123034%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
72
3.31 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123032 ;
Copy
73
3.46 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123032
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123032 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
74
3.73 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 = 126239 ORDER BY t0 . date ASC ;
Copy
75
3.23 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
76
3.69 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
77
2.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 :
[
27491
123032
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123032 LIMIT 1 ;
Copy
78
0.51 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
79
0.39 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
80
3.72 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 " => 123032
"seasonplayer_id " => 126239
"season_id " => 27491
"alignment " => "%"id":123032% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123032 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126239
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123032%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
81
1.66 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 " => 123032
"season_id " => 27491
]
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 = 123032
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
82
1.02 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123032
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123032 LIMIT 1 ;
Copy
83
0.93 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 123032
"seasonplayer_id " => 126239
"season_id " => 27491
"alignment " => "%"id":123032% "
]
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 = 123032 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126239
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123032%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
84
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 = 123032 ;
Copy
85
0.46 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123032
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123032 LIMIT 1 ;
Copy
86
0.40 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
87
1.08 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
88
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 " => 123032
"seasonplayer_id " => 126239
"season_id " => 27491
"alignment " => "%"id":123032% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123032 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126239
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123032%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
89
0.46 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123039 ;
Copy
90
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 = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123039
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123039 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
91
0.37 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 = 126246 ORDER BY t0 . date ASC ;
Copy
92
0.29 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 4 ;
Copy
93
0.31 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
94
0.25 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
95
0.28 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
96
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 :
[
27491
123039
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123039 LIMIT 1 ;
Copy
97
0.26 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
98
0.21 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
99
1.47 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123039
"seasonplayer_id " => 126246
"season_id " => 27491
"alignment " => "%"id":123039% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123039 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126246
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123039%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
100
0.47 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 " => 123039
"season_id " => 27491
]
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 = 123039
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
101
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 :
[
27491
123039
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123039 LIMIT 1 ;
Copy
102
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 " => 123039
"seasonplayer_id " => 126246
"season_id " => 27491
"alignment " => "%"id":123039% "
]
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 = 123039 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126246
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123039%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
103
0.79 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . 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 = 123039 ;
Copy
104
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 :
[
27491
123039
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123039 LIMIT 1 ;
Copy
105
0.26 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
106
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
107
2.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 " => 123039
"seasonplayer_id " => 126246
"season_id " => 27491
"alignment " => "%"id":123039% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123039 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126246
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123039%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
108
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 = 123036 ;
Copy
109
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 :
[
123036
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123036 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
110
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 = 126243 ORDER BY t0 . date ASC ;
Copy
111
3.59 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123036
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123036 LIMIT 1 ;
Copy
112
0.52 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
113
0.38 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
114
2.20 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123036
"seasonplayer_id " => 126243
"season_id " => 27491
"alignment " => "%"id":123036% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123036 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126243
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123036%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
115
0.74 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 123036
"season_id " => 27491
]
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 = 123036
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
116
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 :
[
27491
123036
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123036 LIMIT 1 ;
Copy
117
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 " => 123036
"seasonplayer_id " => 126243
"season_id " => 27491
"alignment " => "%"id":123036% "
]
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 = 123036 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126243
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123036%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
118
0.44 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123036 ;
Copy
119
0.40 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123036
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123036 LIMIT 1 ;
Copy
120
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
121
0.25 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
122
1.99 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 " => 123036
"seasonplayer_id " => 126243
"season_id " => 27491
"alignment " => "%"id":123036% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123036 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126243
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123036%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
123
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 = 123037 ;
Copy
124
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 :
[
123037
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123037 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
125
0.41 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 = 126244 ORDER BY t0 . date ASC ;
Copy
126
0.38 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123037
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123037 LIMIT 1 ;
Copy
127
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
128
0.26 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
129
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 " => 123037
"seasonplayer_id " => 126244
"season_id " => 27491
"alignment " => "%"id":123037% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123037 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126244
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123037%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
130
0.58 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 " => 123037
"season_id " => 27491
]
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 = 123037
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
131
0.40 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123037
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123037 LIMIT 1 ;
Copy
132
0.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 " => 123037
"seasonplayer_id " => 126244
"season_id " => 27491
"alignment " => "%"id":123037% "
]
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 = 123037 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126244
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123037%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
133
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 = 123037 ;
Copy
134
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 :
[
27491
123037
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123037 LIMIT 1 ;
Copy
135
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
136
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
137
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 " => 123037
"seasonplayer_id " => 126244
"season_id " => 27491
"alignment " => "%"id":123037% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123037 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126244
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123037%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
138
0.52 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123029 ;
Copy
139
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 :
[
123029
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123029 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
140
0.49 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126236 ORDER BY t0 . date ASC ;
Copy
141
0.61 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123029
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123029 LIMIT 1 ;
Copy
142
0.40 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
143
0.37 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
144
2.37 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 " => 123029
"seasonplayer_id " => 126236
"season_id " => 27491
"alignment " => "%"id":123029% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123029 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126236
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123029%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
145
0.68 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 " => 123029
"season_id " => 27491
]
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 = 123029
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
146
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 :
[
27491
123029
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123029 LIMIT 1 ;
Copy
147
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 " => 123029
"seasonplayer_id " => 126236
"season_id " => 27491
"alignment " => "%"id":123029% "
]
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 = 123029 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126236
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123029%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
148
0.43 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123029 ;
Copy
149
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 :
[
27491
123029
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123029 LIMIT 1 ;
Copy
150
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
151
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
152
1.66 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 " => 123029
"seasonplayer_id " => 126236
"season_id " => 27491
"alignment " => "%"id":123029% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123029 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126236
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123029%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
153
0.57 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123033 ;
Copy
154
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 :
[
123033
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123033 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
155
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 = 126240 ORDER BY t0 . date ASC ;
Copy
156
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 :
[
27491
123033
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123033 LIMIT 1 ;
Copy
157
0.53 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
158
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
159
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 " => 123033
"seasonplayer_id " => 126240
"season_id " => 27491
"alignment " => "%"id":123033% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123033 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126240
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123033%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
160
0.76 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 123033
"season_id " => 27491
]
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 = 123033
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
161
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 :
[
27491
123033
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123033 LIMIT 1 ;
Copy
162
0.71 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 " => 123033
"seasonplayer_id " => 126240
"season_id " => 27491
"alignment " => "%"id":123033% "
]
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 = 123033 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126240
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123033%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
163
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 = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123033 ;
Copy
164
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 :
[
27491
123033
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123033 LIMIT 1 ;
Copy
165
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
166
0.35 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
167
1.53 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 " => 123033
"seasonplayer_id " => 126240
"season_id " => 27491
"alignment " => "%"id":123033% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123033 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126240
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123033%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
168
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 = 123038 ;
Copy
169
0.44 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123038
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123038 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
170
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 = 126245 ORDER BY t0 . date ASC ;
Copy
171
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 :
[
27491
123038
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123038 LIMIT 1 ;
Copy
172
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
173
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
174
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 " => 123038
"seasonplayer_id " => 126245
"season_id " => 27491
"alignment " => "%"id":123038% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123038 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126245
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123038%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
175
0.51 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 " => 123038
"season_id " => 27491
]
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 = 123038
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
176
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 :
[
27491
123038
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123038 LIMIT 1 ;
Copy
177
0.59 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 " => 123038
"seasonplayer_id " => 126245
"season_id " => 27491
"alignment " => "%"id":123038% "
]
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 = 123038 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126245
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123038%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
178
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 . 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 = 123038 ;
Copy
179
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 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123038
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123038 LIMIT 1 ;
Copy
180
0.26 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
181
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
182
1.41 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 " => 123038
"seasonplayer_id " => 126245
"season_id " => 27491
"alignment " => "%"id":123038% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123038 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126245
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123038%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
183
0.38 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 = 123042 ;
Copy
184
0.50 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123042
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123042 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
185
0.49 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126249 ORDER BY t0 . date ASC ;
Copy
186
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 :
[
27491
123042
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123042 LIMIT 1 ;
Copy
187
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
188
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
189
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 " => 123042
"seasonplayer_id " => 126249
"season_id " => 27491
"alignment " => "%"id":123042% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123042 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126249
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123042%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
190
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 " => 123042
"season_id " => 27491
]
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 = 123042
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
191
5.42 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123042
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123042 LIMIT 1 ;
Copy
192
1.17 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 " => 123042
"seasonplayer_id " => 126249
"season_id " => 27491
"alignment " => "%"id":123042% "
]
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 = 123042 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126249
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123042%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
193
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 = 123042 ;
Copy
194
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 :
[
27491
123042
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123042 LIMIT 1 ;
Copy
195
1.25 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
196
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
197
1.92 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 " => 123042
"seasonplayer_id " => 126249
"season_id " => 27491
"alignment " => "%"id":123042% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123042 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126249
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123042%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
198
0.46 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123040 ;
Copy
199
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 :
[
123040
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123040 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
200
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 = 126247 ORDER BY t0 . date ASC ;
Copy
201
0.33 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123040
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123040 LIMIT 1 ;
Copy
202
0.24 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
203
0.25 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
204
1.84 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 " => 123040
"seasonplayer_id " => 126247
"season_id " => 27491
"alignment " => "%"id":123040% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123040 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126247
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123040%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
205
0.77 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 123040
"season_id " => 27491
]
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 = 123040
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
206
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 :
[
27491
123040
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123040 LIMIT 1 ;
Copy
207
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 " => 123040
"seasonplayer_id " => 126247
"season_id " => 27491
"alignment " => "%"id":123040% "
]
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 = 123040 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126247
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123040%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
208
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 = 123040 ;
Copy
209
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 :
[
27491
123040
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123040 LIMIT 1 ;
Copy
210
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
211
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
212
2.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 " => 123040
"seasonplayer_id " => 126247
"season_id " => 27491
"alignment " => "%"id":123040% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123040 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126247
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123040%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
213
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 = 123035 ;
Copy
214
0.54 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123035
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123035 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
215
0.58 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126242 ORDER BY t0 . date ASC ;
Copy
216
0.39 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 7 ;
Copy
217
0.47 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 7 ;
Copy
218
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 :
[
27491
123035
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123035 LIMIT 1 ;
Copy
219
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
220
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
221
2.28 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123035
"seasonplayer_id " => 126242
"season_id " => 27491
"alignment " => "%"id":123035% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123035 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126242
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123035%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
222
0.73 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 123035
"season_id " => 27491
]
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 = 123035
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
223
0.55 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123035
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123035 LIMIT 1 ;
Copy
224
0.93 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 123035
"seasonplayer_id " => 126242
"season_id " => 27491
"alignment " => "%"id":123035% "
]
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 = 123035 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126242
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123035%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
225
0.47 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123035 ;
Copy
226
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 :
[
27491
123035
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123035 LIMIT 1 ;
Copy
227
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
228
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
229
1.93 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123035
"seasonplayer_id " => 126242
"season_id " => 27491
"alignment " => "%"id":123035% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123035 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126242
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123035%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
230
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 = 123031 ;
Copy
231
11.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 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123031
27491
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at 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 = 123031 AND t0 . season_id = 27491 LIMIT 1 ;
Copy
232
1.78 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126238 ORDER BY t0 . date ASC ;
Copy
233
0.69 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123031
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123031 LIMIT 1 ;
Copy
234
0.51 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
235
0.96 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
236
2.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 " => 123031
"seasonplayer_id " => 126238
"season_id " => 27491
"alignment " => "%"id":123031% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123031 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126238
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123031%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
237
0.82 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 " => 123031
"season_id " => 27491
]
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 = 123031
WHERE ta . season_id = 27491
GROUP BY ta . season_id ;
;
Copy
238
0.55 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123031
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123031 LIMIT 1 ;
Copy
239
0.93 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 123031
"seasonplayer_id " => 126238
"season_id " => 27491
"alignment " => "%"id":123031% "
]
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 = 123031 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126238
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123031%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy
240
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 = 123031 ;
Copy
241
0.56 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27491
123031
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27491 AND t0 . player_id = 123031 LIMIT 1 ;
Copy
242
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
243
0.38 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
244
2.29 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123031
"seasonplayer_id " => 126238
"season_id " => 27491
"alignment " => "%"id":123031% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER 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 = 123031 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126238
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123031%'
WHERE
g . season_id = 27491
AND g . deleted_at IS NULL
;
Copy