1
28.27 ms
SELECT
*
FROM
customer_device
WHERE
:token LIKE CONCAT (token , '%' ) AND
`status` = 0
Parameters :
[
"token " => "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3MzA5MjcyNTgsImV4cCI6MTczMDkzMDg1OCwicm9sZXMiOlsiUk9MRV9DVVNUT01FUiJdLCJ1c2VybmFtZSI6ImFtZWRpbmFAbXVuZGktcmVwLmNvbSJ9.hYoyqLCqueEuj2J0IARS8mm1ttSgJZt2-x3FZt6WDwLSjchYSeoqehCnKZYc8B10jqIjqt-egQTiNKnteaPgQvfMbRz6HTIh3Gakc1K0pDUGyjobQC1tXcUJ8fjDL5LgP38N4oOgQ2jsYexP9s2yD1NTFk3ihwDFnBNspURzoErOhIl0Lyezqe33sh0hZKeiW5t1iV4G_74Ou4EAsJXMmcLUtE6xWwg9S-9EuLSaW3U4vGZDoo7-O4fFgeAnxS7dYC71qwylllSGxvEF1IlpWX6iTrFqHcdj4swje9QDLLLgMbp6H_CZYAKWI1r2L1oFmr_-WbzzxFZ-mTd7xEYVJUEZw_FAKeD0cmQ5Lei-LzDECs1HAPxofbw-SdFS0zd1LxlwiqeBTSpyWKrWTzR4IsiiN-gI_1odwBt5A-hUdOOyNMMYRtF-CEcc8xRXcA8kqLwA-3_G_-YL2lY8Kad1SG0jteOwIll2z90aiFVJ9zvnI93Oc3o-IfXv-XSetjXRNyT14xcdXg7aFYCRGj57TH1DNiAyWzowtmEn4OoTV4ykp7HsPeoDTIUNd7lfbU5G3W1ojvoGxvuI8QSs1r-UJ_FpMfdX7Skf38ReDQwoaV71b4kO2Py_jMIuJWX6vY43Sko6gyeyMG-EDOP-jIEEuVhtMMiOTWWmvMQOayF0GU0 "
]
SELECT
*
FROM
customer_device
WHERE
'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE3MzA5MjcyNTgsImV4cCI6MTczMDkzMDg1OCwicm9sZXMiOlsiUk9MRV9DVVNUT01FUiJdLCJ1c2VybmFtZSI6ImFtZWRpbmFAbXVuZGktcmVwLmNvbSJ9.hYoyqLCqueEuj2J0IARS8mm1ttSgJZt2-x3FZt6WDwLSjchYSeoqehCnKZYc8B10jqIjqt-egQTiNKnteaPgQvfMbRz6HTIh3Gakc1K0pDUGyjobQC1tXcUJ8fjDL5LgP38N4oOgQ2jsYexP9s2yD1NTFk3ihwDFnBNspURzoErOhIl0Lyezqe33sh0hZKeiW5t1iV4G_74Ou4EAsJXMmcLUtE6xWwg9S-9EuLSaW3U4vGZDoo7-O4fFgeAnxS7dYC71qwylllSGxvEF1IlpWX6iTrFqHcdj4swje9QDLLLgMbp6H_CZYAKWI1r2L1oFmr_-WbzzxFZ-mTd7xEYVJUEZw_FAKeD0cmQ5Lei-LzDECs1HAPxofbw-SdFS0zd1LxlwiqeBTSpyWKrWTzR4IsiiN-gI_1odwBt5A-hUdOOyNMMYRtF-CEcc8xRXcA8kqLwA-3_G_-YL2lY8Kad1SG0jteOwIll2z90aiFVJ9zvnI93Oc3o-IfXv-XSetjXRNyT14xcdXg7aFYCRGj57TH1DNiAyWzowtmEn4OoTV4ykp7HsPeoDTIUNd7lfbU5G3W1ojvoGxvuI8QSs1r-UJ_FpMfdX7Skf38ReDQwoaV71b4kO2Py_jMIuJWX6vY43Sko6gyeyMG-EDOP-jIEEuVhtMMiOTWWmvMQOayF0GU0' LIKE CONCAT (token , '%' ) AND
`status` = 0
;
Copy
2
0.73 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 :
[
"amedina@mundi-rep.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 = 'amedina@mundi-rep.com' LIMIT 1 ;
Copy
3
0.66 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 = 26437 ;
Copy
4
1.00 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_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 = 27676 ORDER BY t0 . dorsal ASC ;
Copy
5
0.62 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122331 ;
Copy
6
0.45 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 123074 ;
Copy
7
0.43 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123074
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123074 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
8
0.61 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 126281 ORDER BY t0 . date ASC ;
Copy
9
0.58 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
10
0.57 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
11
0.30 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 4 ;
Copy
12
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 = 4 ;
Copy
13
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 :
[
27676
123074
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 123074 LIMIT 1 ;
Copy
14
0.59 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
15
0.49 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
16
2.46 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123074
"seasonplayer_id " => 126281
"season_id " => 27676
"alignment " => "%"id":123074% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 123074 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126281
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123074%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
17
1.14 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 123074
"season_id " => 27676
]
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 = 123074
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
18
0.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 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
123074
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 123074 LIMIT 1 ;
Copy
19
0.96 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 123074
"seasonplayer_id " => 126281
"season_id " => 27676
"alignment " => "%"id":123074% "
]
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 = 123074 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126281
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123074%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
20
0.66 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . 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 = 123074 ;
Copy
21
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 :
[
27676
123074
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 123074 LIMIT 1 ;
Copy
22
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
23
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
24
1.43 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 123074
"seasonplayer_id " => 126281
"season_id " => 27676
"alignment " => "%"id":123074% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 123074 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126281
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123074%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
25
0.76 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 = 26504 ;
Copy
26
0.60 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 = 123073 ;
Copy
27
8.95 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
123073
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123073 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
28
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 = 126280 ORDER BY t0 . date ASC ;
Copy
29
0.33 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
30
0.39 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
31
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 :
[
27676
123073
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 123073 LIMIT 1 ;
Copy
32
0.32 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
33
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
34
1.69 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 " => 123073
"seasonplayer_id " => 126280
"season_id " => 27676
"alignment " => "%"id":123073% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 123073 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126280
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123073%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
35
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 " => 123073
"season_id " => 27676
]
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 = 123073
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
36
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 :
[
27676
123073
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 123073 LIMIT 1 ;
Copy
37
1.07 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 " => 123073
"seasonplayer_id " => 126280
"season_id " => 27676
"alignment " => "%"id":123073% "
]
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 = 123073 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126280
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123073%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
38
0.42 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 123073 ;
Copy
39
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 :
[
27676
123073
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 123073 LIMIT 1 ;
Copy
40
0.28 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
41
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
42
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 " => 123073
"seasonplayer_id " => 126280
"season_id " => 27676
"alignment " => "%"id":123073% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 123073 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126280
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":123073%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
43
0.45 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122962 ;
Copy
44
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 :
[
122962
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122962 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
45
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 = 126169 ORDER BY t0 . date ASC ;
Copy
46
0.32 ms
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . slug AS slug_2 , t0 . image AS image_3 , t0 . updated_at AS updated_at_4 , t0 . field_position AS field_position_5 FROM position t0 WHERE t0 . id = 5 ;
Copy
47
0.41 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 5 ;
Copy
48
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 :
[
27676
122962
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122962 LIMIT 1 ;
Copy
49
0.33 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
50
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
51
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 " => 122962
"seasonplayer_id " => 126169
"season_id " => 27676
"alignment " => "%"id":122962% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122962 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126169
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122962%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
52
0.63 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122962
"season_id " => 27676
]
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 = 122962
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
53
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 :
[
27676
122962
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122962 LIMIT 1 ;
Copy
54
0.78 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122962
"seasonplayer_id " => 126169
"season_id " => 27676
"alignment " => "%"id":122962% "
]
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 = 122962 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126169
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122962%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
55
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 = 122962 ;
Copy
56
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 :
[
27676
122962
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122962 LIMIT 1 ;
Copy
57
0.28 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
58
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
59
1.64 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122962
"seasonplayer_id " => 126169
"season_id " => 27676
"alignment " => "%"id":122962% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122962 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 126169
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122962%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
60
0.41 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122574 ;
Copy
61
0.39 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122574
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122574 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
62
0.38 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 125781 ORDER BY t0 . date ASC ;
Copy
63
0.31 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
64
0.35 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
65
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 :
[
27676
122574
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122574 LIMIT 1 ;
Copy
66
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
67
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
68
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 " => 122574
"seasonplayer_id " => 125781
"season_id " => 27676
"alignment " => "%"id":122574% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122574 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125781
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122574%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
69
1.24 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 " => 122574
"season_id " => 27676
]
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 = 122574
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
70
0.48 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122574
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122574 LIMIT 1 ;
Copy
71
0.90 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122574
"seasonplayer_id " => 125781
"season_id " => 27676
"alignment " => "%"id":122574% "
]
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 = 122574 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125781
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122574%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
72
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 . 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 = 122574 ;
Copy
73
0.41 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122574
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122574 LIMIT 1 ;
Copy
74
0.32 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
75
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
76
1.73 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122574
"seasonplayer_id " => 125781
"season_id " => 27676
"alignment " => "%"id":122574% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122574 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125781
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122574%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
77
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 = 122573 ;
Copy
78
0.49 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122573
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122573 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
79
0.38 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 125780 ORDER BY t0 . date ASC ;
Copy
80
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 :
[
27676
122573
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122573 LIMIT 1 ;
Copy
81
0.36 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
82
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
83
1.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 " => 122573
"seasonplayer_id " => 125780
"season_id " => 27676
"alignment " => "%"id":122573% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122573 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125780
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122573%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
84
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 " => 122573
"season_id " => 27676
]
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 = 122573
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
85
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 :
[
27676
122573
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122573 LIMIT 1 ;
Copy
86
1.08 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 " => 122573
"seasonplayer_id " => 125780
"season_id " => 27676
"alignment " => "%"id":122573% "
]
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 = 122573 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125780
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122573%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
87
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 = 122573 ;
Copy
88
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 :
[
27676
122573
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122573 LIMIT 1 ;
Copy
89
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
90
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
91
1.70 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122573
"seasonplayer_id " => 125780
"season_id " => 27676
"alignment " => "%"id":122573% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122573 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125780
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122573%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
92
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 = 122338 ;
Copy
93
0.39 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122337 ;
Copy
94
0.41 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122336 ;
Copy
95
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 = 122335 ;
Copy
96
0.39 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122335
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122335 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
97
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 = 125535 ORDER BY t0 . date ASC ;
Copy
98
0.35 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
99
0.42 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . description AS description_3 , t0 . slug_translation AS slug_translation_4 , t0 . locale AS locale_5 , t0 . translatable_id AS translatable_id_6 FROM position_translation t0 WHERE t0 . translatable_id = 6 ;
Copy
100
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 :
[
27676
122335
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122335 LIMIT 1 ;
Copy
101
0.32 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
102
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
103
2.06 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122335
"seasonplayer_id " => 125535
"season_id " => 27676
"alignment " => "%"id":122335% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122335 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125535
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122335%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
104
0.63 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122335
"season_id " => 27676
]
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 = 122335
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
105
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 :
[
27676
122335
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122335 LIMIT 1 ;
Copy
106
1.23 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122335
"seasonplayer_id " => 125535
"season_id " => 27676
"alignment " => "%"id":122335% "
]
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 = 122335 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125535
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122335%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
107
0.42 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122335 ;
Copy
108
0.83 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122335
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122335 LIMIT 1 ;
Copy
109
0.35 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
110
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
111
2.67 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 " => 122335
"seasonplayer_id " => 125535
"season_id " => 27676
"alignment " => "%"id":122335% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122335 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125535
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122335%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
112
0.53 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122334 ;
Copy
113
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 :
[
122334
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122334 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
114
0.50 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 125534 ORDER BY t0 . date ASC ;
Copy
115
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 :
[
27676
122334
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122334 LIMIT 1 ;
Copy
116
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
117
0.32 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
118
2.83 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122334
"seasonplayer_id " => 125534
"season_id " => 27676
"alignment " => "%"id":122334% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122334 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125534
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122334%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
119
0.83 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 " => 122334
"season_id " => 27676
]
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 = 122334
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
120
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 :
[
27676
122334
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122334 LIMIT 1 ;
Copy
121
1.21 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122334
"seasonplayer_id " => 125534
"season_id " => 27676
"alignment " => "%"id":122334% "
]
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 = 122334 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125534
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122334%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
122
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 = 122334 ;
Copy
123
0.48 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122334
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122334 LIMIT 1 ;
Copy
124
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
125
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
126
2.60 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 " => 122334
"seasonplayer_id " => 125534
"season_id " => 27676
"alignment " => "%"id":122334% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122334 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125534
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122334%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
127
0.62 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122333 ;
Copy
128
0.61 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122333
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122333 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
129
0.64 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 125533 ORDER BY t0 . date ASC ;
Copy
130
0.73 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122333
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122333 LIMIT 1 ;
Copy
131
0.80 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
132
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
133
2.05 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122333
"seasonplayer_id " => 125533
"season_id " => 27676
"alignment " => "%"id":122333% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122333 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125533
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122333%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
134
0.86 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 " => 122333
"season_id " => 27676
]
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 = 122333
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
135
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 :
[
27676
122333
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122333 LIMIT 1 ;
Copy
136
0.97 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122333
"seasonplayer_id " => 125533
"season_id " => 27676
"alignment " => "%"id":122333% "
]
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 = 122333 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125533
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122333%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
137
0.30 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122333 ;
Copy
138
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 :
[
27676
122333
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122333 LIMIT 1 ;
Copy
139
1.07 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
140
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
141
1.81 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122333
"seasonplayer_id " => 125533
"season_id " => 27676
"alignment " => "%"id":122333% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122333 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125533
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122333%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
142
0.45 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122332 ;
Copy
143
0.37 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122332
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122332 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
144
0.39 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 = 125532 ORDER BY t0 . date ASC ;
Copy
145
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 :
[
27676
122332
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122332 LIMIT 1 ;
Copy
146
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
147
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
148
2.46 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122332
"seasonplayer_id " => 125532
"season_id " => 27676
"alignment " => "%"id":122332% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122332 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125532
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122332%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
149
1.00 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 " => 122332
"season_id " => 27676
]
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 = 122332
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
150
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 :
[
27676
122332
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122332 LIMIT 1 ;
Copy
151
1.13 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 " => 122332
"seasonplayer_id " => 125532
"season_id " => 27676
"alignment " => "%"id":122332% "
]
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 = 122332 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125532
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122332%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
152
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 = 122332 ;
Copy
153
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 :
[
27676
122332
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122332 LIMIT 1 ;
Copy
154
0.36 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
155
0.71 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
156
2.71 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122332
"seasonplayer_id " => 125532
"season_id " => 27676
"alignment " => "%"id":122332% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122332 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125532
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122332%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
157
0.55 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122319 ;
Copy
158
1.07 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122319
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122319 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
159
0.82 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 = 125519 ORDER BY t0 . date ASC ;
Copy
160
0.47 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
161
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 = 1 ;
Copy
162
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 :
[
27676
122319
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122319 LIMIT 1 ;
Copy
163
0.32 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
164
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
165
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 " => 122319
"seasonplayer_id " => 125519
"season_id " => 27676
"alignment " => "%"id":122319% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122319 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125519
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122319%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
166
0.65 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122319
"season_id " => 27676
]
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 = 122319
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
167
0.64 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_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 :
[
27676
122319
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122319 LIMIT 1 ;
Copy
168
1.04 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 " => 122319
"seasonplayer_id " => 125519
"season_id " => 27676
"alignment " => "%"id":122319% "
]
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 = 122319 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125519
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122319%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
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 = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122319 ;
Copy
170
1.67 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122319
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122319 LIMIT 1 ;
Copy
171
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
172
0.42 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
173
2.74 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 " => 122319
"seasonplayer_id " => 125519
"season_id " => 27676
"alignment " => "%"id":122319% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122319 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125519
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122319%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
174
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 = 122330 ;
Copy
175
0.55 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122330
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122330 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
176
0.59 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 125530 ORDER BY t0 . date ASC ;
Copy
177
2.22 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_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 :
[
27676
122330
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122330 LIMIT 1 ;
Copy
178
0.60 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
179
0.56 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
180
3.56 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122330
"seasonplayer_id " => 125530
"season_id " => 27676
"alignment " => "%"id":122330% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122330 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125530
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122330%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
181
1.04 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 " => 122330
"season_id " => 27676
]
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 = 122330
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
182
0.57 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122330
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122330 LIMIT 1 ;
Copy
183
1.39 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 " => 122330
"seasonplayer_id " => 125530
"season_id " => 27676
"alignment " => "%"id":122330% "
]
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 = 122330 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125530
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122330%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
184
0.55 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122330 ;
Copy
185
0.58 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122330
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122330 LIMIT 1 ;
Copy
186
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
187
0.40 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
188
4.27 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122330
"seasonplayer_id " => 125530
"season_id " => 27676
"alignment " => "%"id":122330% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122330 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125530
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122330%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
189
0.63 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 = 122329 ;
Copy
190
0.70 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122329
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122329 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
191
0.69 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 = 125529 ORDER BY t0 . date ASC ;
Copy
192
0.83 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122329
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122329 LIMIT 1 ;
Copy
193
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
194
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
195
3.00 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122329
"seasonplayer_id " => 125529
"season_id " => 27676
"alignment " => "%"id":122329% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122329 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125529
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122329%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
196
0.93 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 " => 122329
"season_id " => 27676
]
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 = 122329
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
197
0.64 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_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 :
[
27676
122329
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122329 LIMIT 1 ;
Copy
198
2.10 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 " => 122329
"seasonplayer_id " => 125529
"season_id " => 27676
"alignment " => "%"id":122329% "
]
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 = 122329 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125529
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122329%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
199
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 . 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 = 122329 ;
Copy
200
0.51 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122329
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122329 LIMIT 1 ;
Copy
201
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
202
0.44 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
203
3.94 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 " => 122329
"seasonplayer_id " => 125529
"season_id " => 27676
"alignment " => "%"id":122329% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122329 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125529
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122329%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
204
0.51 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 = 122328 ;
Copy
205
0.59 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122328
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122328 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
206
0.67 ms
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = ? ORDER BY t0 . date ASC
SELECT t0 . id AS id_1 , t0 . weight AS weight_2 , t0 . date AS date_3 , t0 . time AS time_4 , t0 . season_player_id AS season_player_id_5 FROM player_weight t0 WHERE t0 . season_player_id = 125528 ORDER BY t0 . date ASC ;
Copy
207
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 :
[
27676
122328
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122328 LIMIT 1 ;
Copy
208
0.43 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
209
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
210
3.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 " => 122328
"seasonplayer_id " => 125528
"season_id " => 27676
"alignment " => "%"id":122328% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122328 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125528
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122328%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
211
1.05 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 " => 122328
"season_id " => 27676
]
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 = 122328
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
212
0.65 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122328
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122328 LIMIT 1 ;
Copy
213
1.15 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 " => 122328
"seasonplayer_id " => 125528
"season_id " => 27676
"alignment " => "%"id":122328% "
]
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 = 122328 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125528
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122328%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
214
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 = 122328 ;
Copy
215
0.48 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122328
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122328 LIMIT 1 ;
Copy
216
0.58 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
217
0.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
218
3.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 " => 122328
"seasonplayer_id " => 125528
"season_id " => 27676
"alignment " => "%"id":122328% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122328 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125528
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122328%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
219
0.63 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 = 122327 ;
Copy
220
1.12 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122327
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122327 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
221
0.88 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 = 125527 ORDER BY t0 . date ASC ;
Copy
222
0.65 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122327
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122327 LIMIT 1 ;
Copy
223
1.17 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
224
0.50 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
225
4.26 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122327
"seasonplayer_id " => 125527
"season_id " => 27676
"alignment " => "%"id":122327% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122327 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125527
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122327%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
226
1.14 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122327
"season_id " => 27676
]
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 = 122327
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
227
0.73 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122327
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122327 LIMIT 1 ;
Copy
228
1.50 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 " => 122327
"seasonplayer_id " => 125527
"season_id " => 27676
"alignment " => "%"id":122327% "
]
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 = 122327 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125527
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122327%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
229
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 = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122327 ;
Copy
230
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 :
[
27676
122327
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122327 LIMIT 1 ;
Copy
231
0.36 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
232
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
233
3.15 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122327
"seasonplayer_id " => 125527
"season_id " => 27676
"alignment " => "%"id":122327% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122327 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125527
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122327%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
234
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 = 122326 ;
Copy
235
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 :
[
122326
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122326 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
236
1.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 = 125526 ORDER BY t0 . date ASC ;
Copy
237
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 :
[
27676
122326
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122326 LIMIT 1 ;
Copy
238
0.33 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
239
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
240
1.91 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 " => 122326
"seasonplayer_id " => 125526
"season_id " => 27676
"alignment " => "%"id":122326% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122326 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125526
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122326%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
241
0.63 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122326
"season_id " => 27676
]
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 = 122326
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
242
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 :
[
27676
122326
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122326 LIMIT 1 ;
Copy
243
0.96 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122326
"seasonplayer_id " => 125526
"season_id " => 27676
"alignment " => "%"id":122326% "
]
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 = 122326 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125526
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122326%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
244
0.32 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122326 ;
Copy
245
1.00 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_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 :
[
27676
122326
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122326 LIMIT 1 ;
Copy
246
0.50 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
247
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
248
3.14 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122326
"seasonplayer_id " => 125526
"season_id " => 27676
"alignment " => "%"id":122326% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122326 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125526
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122326%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
249
0.64 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 = 122325 ;
Copy
250
0.43 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122325
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122325 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
251
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 = 125525 ORDER BY t0 . date ASC ;
Copy
252
0.48 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122325
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122325 LIMIT 1 ;
Copy
253
0.32 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
254
0.27 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
255
2.91 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 " => 122325
"seasonplayer_id " => 125525
"season_id " => 27676
"alignment " => "%"id":122325% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122325 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125525
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122325%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
256
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 " => 122325
"season_id " => 27676
]
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 = 122325
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
257
0.72 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122325
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122325 LIMIT 1 ;
Copy
258
1.02 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122325
"seasonplayer_id " => 125525
"season_id " => 27676
"alignment " => "%"id":122325% "
]
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 = 122325 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125525
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122325%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
259
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 = 122325 ;
Copy
260
0.41 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122325
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122325 LIMIT 1 ;
Copy
261
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
262
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
263
2.52 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 " => 122325
"seasonplayer_id " => 125525
"season_id " => 27676
"alignment " => "%"id":122325% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122325 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125525
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122325%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
264
0.47 ms
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = ?
SELECT t0 . id AS id_1 , t0 . name AS name_2 , t0 . lastname AS lastname_3 , t0 . age AS age_4 , t0 . weight AS weight_5 , t0 . height AS height_6 , t0 . shoes AS shoes_7 , t0 . image AS image_8 , t0 . updated_at AS updated_at_9 , t0 . skillful_leg AS skillful_leg_10 , t0 . is_active AS is_active_11 , t0 . birth_date AS birth_date_12 , t0 . phone AS phone_13 , t0 . email AS email_14 , t0 . number_document AS number_document_15 , t0 . health_card AS health_card_16 , t0 . date_of_birth AS date_of_birth_17 , t0 . medical_review_date AS medical_review_date_18 , t0 . last_club AS last_club_19 , t0 . deleted_at AS deleted_at_20 , t0 . position_id AS position_id_21 , t0 . secondary_position_id AS secondary_position_id_22 , t0 . country_id AS country_id_23 FROM player t0 WHERE t0 . id = 122324 ;
Copy
265
1.24 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122324
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122324 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
266
0.45 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 = 125524 ORDER BY t0 . date ASC ;
Copy
267
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 :
[
27676
122324
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122324 LIMIT 1 ;
Copy
268
0.32 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
269
0.27 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
270
3.81 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122324
"seasonplayer_id " => 125524
"season_id " => 27676
"alignment " => "%"id":122324% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122324 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125524
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122324%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
271
0.79 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122324
"season_id " => 27676
]
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 = 122324
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
272
0.41 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122324
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122324 LIMIT 1 ;
Copy
273
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 " => 122324
"seasonplayer_id " => 125524
"season_id " => 27676
"alignment " => "%"id":122324% "
]
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 = 122324 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125524
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122324%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
274
0.27 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122324 ;
Copy
275
0.36 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122324
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122324 LIMIT 1 ;
Copy
276
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
277
0.17 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
278
1.73 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122324
"seasonplayer_id " => 125524
"season_id " => 27676
"alignment " => "%"id":122324% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122324 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125524
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122324%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
279
1.70 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 = 122323 ;
Copy
280
3.76 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122323
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122323 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
281
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 = 125523 ORDER BY t0 . date ASC ;
Copy
282
0.31 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122323
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122323 LIMIT 1 ;
Copy
283
0.23 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
284
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
285
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 " => 122323
"seasonplayer_id " => 125523
"season_id " => 27676
"alignment " => "%"id":122323% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122323 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125523
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122323%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
286
0.57 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122323
"season_id " => 27676
]
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 = 122323
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
287
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 :
[
27676
122323
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122323 LIMIT 1 ;
Copy
288
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 " => 122323
"seasonplayer_id " => 125523
"season_id " => 27676
"alignment " => "%"id":122323% "
]
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 = 122323 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125523
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122323%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
289
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 = 122323 ;
Copy
290
0.26 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122323
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122323 LIMIT 1 ;
Copy
291
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
292
0.18 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
293
1.59 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 " => 122323
"seasonplayer_id " => 125523
"season_id " => 27676
"alignment " => "%"id":122323% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122323 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125523
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122323%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
294
0.36 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 = 122322 ;
Copy
295
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 = 122321 ;
Copy
296
0.31 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122321
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122321 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
297
0.32 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 = 125521 ORDER BY t0 . date ASC ;
Copy
298
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 :
[
27676
122321
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122321 LIMIT 1 ;
Copy
299
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
300
0.19 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
301
1.58 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122321
"seasonplayer_id " => 125521
"season_id " => 27676
"alignment " => "%"id":122321% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122321 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125521
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122321%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
302
0.57 ms
SELECT
ta . id ,
SUM (IF (tap . player_id IS NULL , 0 , 1 )) AS trainingAsist ,
COUNT (ta . id ) AS trainingAsistTotal
FROM training_asist AS ta
LEFT JOIN training_asist_player AS tap ON ta . id = tap . training_asist_id AND tap . player_id = :player_id
WHERE ta . season_id = :season_id
GROUP BY ta . season_id ;
Parameters :
[
"player_id " => 122321
"season_id " => 27676
]
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 = 122321
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
303
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 :
[
27676
122321
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122321 LIMIT 1 ;
Copy
304
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 " => 122321
"seasonplayer_id " => 125521
"season_id " => 27676
"alignment " => "%"id":122321% "
]
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 = 122321 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125521
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122321%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
305
0.28 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . 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 = 122321 ;
Copy
306
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 :
[
27676
122321
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122321 LIMIT 1 ;
Copy
307
0.23 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
308
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
309
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 " => 122321
"seasonplayer_id " => 125521
"season_id " => 27676
"alignment " => "%"id":122321% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122321 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125521
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122321%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
310
0.44 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 = 122320 ;
Copy
311
0.32 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ? AND t0 . season_id = ? LIMIT 1
Parameters :
[
122320
27676
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122320 AND t0 . season_id = 27676 LIMIT 1 ;
Copy
312
0.30 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 = 125520 ORDER BY t0 . date ASC ;
Copy
313
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 :
[
27676
122320
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122320 LIMIT 1 ;
Copy
314
0.22 ms
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0
SELECT t0 . id AS id_1 , t0 . icon AS icon_2 , t0 . created_at AS created_at_3 , t0 . nro_order AS nro_order_4 , t0 . show_training AS show_training_5 , t0 . show_announcement AS show_announcement_6 FROM justification_type t0 ;
Copy
315
0.18 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
316
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 " => 122320
"seasonplayer_id " => 125520
"season_id " => 27676
"alignment " => "%"id":122320% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122320 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125520
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122320%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
317
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 " => 122320
"season_id " => 27676
]
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 = 122320
WHERE ta . season_id = 27676
GROUP BY ta . season_id ;
;
Copy
318
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 :
[
27676
122320
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122320 LIMIT 1 ;
Copy
319
0.67 ms
SELECT
SUM (IF (cp . player_id IS NOT NULL , 1 , 0 )) AS `convocatory` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `titularity` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 1 , 1 , 0 )) AS `isTitular` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 , 1 , 0 )) AS `intitularity` ,
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS countPlayed ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `convocatoriaAlignment` ,
SUM (IF (g . id IS NOT NULL , g . time_match , 0 )) AS time_match ,
COUNT (* ) AS convocatoriaTotal
FROM
game g
LEFT JOIN convocatoria c ON g . id = c . game_id
LEFT JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id1 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id1 " => 122320
"seasonplayer_id " => 125520
"season_id " => 27676
"alignment " => "%"id":122320% "
]
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 = 122320 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125520
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122320%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy
320
0.27 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = ?
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . player_id = 122320 ;
Copy
321
0.26 ms
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = ? AND t0 . player_id = ? LIMIT 1
Parameters :
[
27676
122320
]
SELECT t0 . id AS id_1 , t0 . games AS games_2 , t0 . goals AS goals_3 , t0 . yellow_card AS yellow_card_4 , t0 . red_card AS red_card_5 , t0 . dorsal AS dorsal_6 , t0 . is_active AS is_active_7 , t0 . deleted_at AS deleted_at_8 , t0 . season_id AS season_id_9 , t0 . player_id AS player_id_10 FROM season_player t0 WHERE t0 . season_id = 27676 AND t0 . player_id = 122320 LIMIT 1 ;
Copy
322
0.20 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
323
0.17 ms
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0
SELECT t0 . id AS id_1 , t0 . image AS image_2 , t0 . created_at AS created_at_3 , t0 . updated_at AS updated_at_4 FROM competition t0 ;
Copy
324
1.38 ms
SELECT
SUM (IF (gps . id IS NOT NULL , gps . minutes , 0 )) AS `minutes` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . minutes , 0 )) AS `minutes_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . minutes , 0 )) AS `minutes_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . minutes , 0 )) AS `minutes_3` ,
SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 1 , 1 , 0 )) AS `convocatory_1` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 2 , 1 , 0 )) AS `convocatory_2` , SUM (IF (cp . player_id IS NOT NULL AND g . competition_id = 3 , 1 , 0 )) AS `convocatory_3` ,
SUM (IF (gps . id IS NOT NULL , gps . red_cards , 0 )) AS `redCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . red_cards , 0 )) AS `redCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . red_cards , 0 )) AS `redCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . red_cards , 0 )) AS `redCards_3` ,
SUM (IF (gps . id IS NOT NULL , gps . yellow_cards , 0 )) AS `yellowCards` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . yellow_cards , 0 )) AS `yellowCards_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . yellow_cards , 0 )) AS `yellowCards_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . yellow_cards , 0 )) AS `yellowCards_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 , 1 , 0 )) AS games , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 1 , 1 , 0 )) AS `games_1` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 2 , 1 , 0 )) AS `games_2` , SUM (IF (gps . id IS NOT NULL AND gps . minutes > 0 AND g . competition_id = 3 , 1 , 0 )) AS `games_3` ,
SUM (IF (gps . id IS NOT NULL , gps . kilometers_traveled , 0 )) AS `kilometersTraveled` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . kilometers_traveled , 0 )) AS `kilometersTraveled_3` ,
SUM (IF (gps . id IS NOT NULL , gps . shots_on_goal , 0 )) AS `shotsOnGoal` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . shots_on_goal , 0 )) AS `shotsOnGoal_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stolen_balls , 0 )) AS `stolenBalls` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stolen_balls , 0 )) AS `stolenBalls_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stolen_balls , 0 )) AS `stolenBalls_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stolen_balls , 0 )) AS `stolenBalls_3` ,
SUM (IF (gps . id IS NOT NULL , gps . penalties_committed , 0 )) AS `penaltiesCommitted` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . penalties_committed , 0 )) AS `penaltiesCommitted_3` ,
SUM (IF (gps . id IS NOT NULL , gps . forced_penalties , 0 )) AS `forcedPenalties` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . forced_penalties , 0 )) AS `forcedPenalties_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . forced_penalties , 0 )) AS `forcedPenalties_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . forced_penalties , 0 )) AS `forcedPenalties_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goals , 0 )) AS `goals` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goals , 0 )) AS `goals_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goals , 0 )) AS `goals_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goals , 0 )) AS `goals_3` ,
SUM (IF (gps . id IS NOT NULL , gps . goal_assistances , 0 )) AS `goalAssistances` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . goal_assistances , 0 )) AS `goalAssistances_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . goal_assistances , 0 )) AS `goalAssistances_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . goal_assistances , 0 )) AS `goalAssistances_3` ,
SUM (IF (gps . id IS NOT NULL , gps . is_titular , 0 )) AS `isTitular` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . is_titular , 0 )) AS `isTitular_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . is_titular , 0 )) AS `isTitular_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . is_titular , 0 )) AS `isTitular_3` ,
SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 1 , 1 , 0 )) AS `intitularity_1` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 2 , 1 , 0 )) AS `intitularity_2` , SUM (IF (gps . id IS NOT NULL AND gps . is_titular = 0 AND g . competition_id = 3 , 1 , 0 )) AS `intitularity_3` ,
SUM (IF (gps . id IS NOT NULL , gps . stops_made , 0 )) AS `stopsMade` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 1 , gps . stops_made , 0 )) AS `stopsMade_1` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 2 , gps . stops_made , 0 )) AS `stopsMade_2` , SUM (IF (gps . id IS NOT NULL AND g . competition_id = 3 , gps . stops_made , 0 )) AS `stopsMade_3` ,
SUM (IF (cp . justification_type_id = 1 , 1 , 0 )) AS `justificationTypeTotal_1` , SUM (IF (cp . justification_type_id = 2 , 1 , 0 )) AS `justificationTypeTotal_2` , SUM (IF (cp . justification_type_id = 3 , 1 , 0 )) AS `justificationTypeTotal_3` , SUM (IF (cp . justification_type_id = 4 , 1 , 0 )) AS `justificationTypeTotal_4` , SUM (IF (cp . justification_type_id = 5 , 1 , 0 )) AS `justificationTypeTotal_5` , SUM (IF (cp . justification_type_id = 6 , 1 , 0 )) AS `justificationTypeTotal_6` , SUM (IF (cp . justification_type_id = 7 , 1 , 0 )) AS `justificationTypeTotal_7` , SUM (IF (cp . justification_type_id = 8 , 1 , 0 )) AS `justificationTypeTotal_8` , SUM (IF (cp . justification_type_id = 9 , 1 , 0 )) AS `justificationTypeTotal_9` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_1_1` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_2_1` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_3_1` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_4_1` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_5_1` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_6_1` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_7_1` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_8_1` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 1 , 1 , 0 )) AS `justificationType_9_1` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_1_2` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_2_2` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_3_2` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_4_2` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_5_2` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_6_2` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_7_2` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_8_2` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 2 , 1 , 0 )) AS `justificationType_9_2` , SUM (IF (cp . justification_type_id = 1 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_1_3` , SUM (IF (cp . justification_type_id = 2 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_2_3` , SUM (IF (cp . justification_type_id = 3 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_3_3` , SUM (IF (cp . justification_type_id = 4 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_4_3` , SUM (IF (cp . justification_type_id = 5 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_5_3` , SUM (IF (cp . justification_type_id = 6 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_6_3` , SUM (IF (cp . justification_type_id = 7 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_7_3` , SUM (IF (cp . justification_type_id = 8 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_8_3` , SUM (IF (cp . justification_type_id = 9 AND g . competition_id = 3 , 1 , 0 )) AS `justificationType_9_3` ,
SUM (IF (ga . id IS NOT NULL , 1 , 0 )) AS `gameAlignment` ,
SUM (IF (cp . is_active = 1 , 1 , 0 )) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id AND cp . player_id = :player_id AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE :alignment
WHERE
g . season_id = :season_id
AND g . deleted_at IS NULL
Parameters :
[
"player_id " => 122320
"seasonplayer_id " => 125520
"season_id " => 27676
"alignment " => "%"id":122320% "
]
SELECT
SUM (
IF (gps . id IS NOT NULL , gps . minutes , 0 )
) AS `minutes` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . minutes ,
0
)
) AS `minutes_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . minutes ,
0
)
) AS `minutes_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . minutes ,
0
)
) AS `minutes_3` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 1 ,
1 ,
0
)
) AS `convocatory_1` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 2 ,
1 ,
0
)
) AS `convocatory_2` ,
SUM (
IF (
cp . player_id IS NOT NULL
AND g . competition_id = 3 ,
1 ,
0
)
) AS `convocatory_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . red_cards , 0
)
) AS `redCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . red_cards ,
0
)
) AS `redCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . red_cards ,
0
)
) AS `redCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . red_cards ,
0
)
) AS `redCards_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . yellow_cards ,
0
)
) AS `yellowCards` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . yellow_cards ,
0
)
) AS `yellowCards_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0 ,
1 ,
0
)
) AS games ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `games_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `games_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . minutes > 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `games_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . kilometers_traveled ,
0
)
) AS `kilometersTraveled_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . shots_on_goal ,
0
)
) AS `shotsOnGoal` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . shots_on_goal ,
0
)
) AS `shotsOnGoal_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stolen_balls ,
0
)
) AS `stolenBalls` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stolen_balls ,
0
)
) AS `stolenBalls_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . penalties_committed ,
0
)
) AS `penaltiesCommitted` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . penalties_committed ,
0
)
) AS `penaltiesCommitted_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . forced_penalties ,
0
)
) AS `forcedPenalties` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . forced_penalties ,
0
)
) AS `forcedPenalties_3` ,
SUM (
IF (gps . id IS NOT NULL , gps . goals , 0 )
) AS `goals` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goals ,
0
)
) AS `goals_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goals ,
0
)
) AS `goals_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goals ,
0
)
) AS `goals_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . goal_assistances ,
0
)
) AS `goalAssistances` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . goal_assistances ,
0
)
) AS `goalAssistances_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . is_titular ,
0
)
) AS `isTitular` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . is_titular ,
0
)
) AS `isTitular_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . is_titular ,
0
)
) AS `isTitular_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . is_titular ,
0
)
) AS `isTitular_3` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 1 ,
1 ,
0
)
) AS `intitularity_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 2 ,
1 ,
0
)
) AS `intitularity_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND gps . is_titular = 0
AND g . competition_id = 3 ,
1 ,
0
)
) AS `intitularity_3` ,
SUM (
IF (
gps . id IS NOT NULL , gps . stops_made ,
0
)
) AS `stopsMade` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 1 ,
gps . stops_made ,
0
)
) AS `stopsMade_1` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 2 ,
gps . stops_made ,
0
)
) AS `stopsMade_2` ,
SUM (
IF (
gps . id IS NOT NULL
AND g . competition_id = 3 ,
gps . stops_made ,
0
)
) AS `stopsMade_3` ,
SUM (
IF (cp . justification_type_id = 1 , 1 , 0 )
) AS `justificationTypeTotal_1` ,
SUM (
IF (cp . justification_type_id = 2 , 1 , 0 )
) AS `justificationTypeTotal_2` ,
SUM (
IF (cp . justification_type_id = 3 , 1 , 0 )
) AS `justificationTypeTotal_3` ,
SUM (
IF (cp . justification_type_id = 4 , 1 , 0 )
) AS `justificationTypeTotal_4` ,
SUM (
IF (cp . justification_type_id = 5 , 1 , 0 )
) AS `justificationTypeTotal_5` ,
SUM (
IF (cp . justification_type_id = 6 , 1 , 0 )
) AS `justificationTypeTotal_6` ,
SUM (
IF (cp . justification_type_id = 7 , 1 , 0 )
) AS `justificationTypeTotal_7` ,
SUM (
IF (cp . justification_type_id = 8 , 1 , 0 )
) AS `justificationTypeTotal_8` ,
SUM (
IF (cp . justification_type_id = 9 , 1 , 0 )
) AS `justificationTypeTotal_9` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_1_1` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_2_1` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_3_1` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_4_1` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_5_1` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_6_1` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_7_1` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_8_1` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 1 ,
1 ,
0
)
) AS `justificationType_9_1` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_1_2` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_2_2` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_3_2` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_4_2` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_5_2` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_6_2` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_7_2` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_8_2` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 2 ,
1 ,
0
)
) AS `justificationType_9_2` ,
SUM (
IF (
cp . justification_type_id = 1
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_1_3` ,
SUM (
IF (
cp . justification_type_id = 2
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_2_3` ,
SUM (
IF (
cp . justification_type_id = 3
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_3_3` ,
SUM (
IF (
cp . justification_type_id = 4
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_4_3` ,
SUM (
IF (
cp . justification_type_id = 5
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_5_3` ,
SUM (
IF (
cp . justification_type_id = 6
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_6_3` ,
SUM (
IF (
cp . justification_type_id = 7
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_7_3` ,
SUM (
IF (
cp . justification_type_id = 8
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_8_3` ,
SUM (
IF (
cp . justification_type_id = 9
AND g . competition_id = 3 ,
1 ,
0
)
) AS `justificationType_9_3` ,
SUM (
IF (ga . id IS NOT NULL , 1 , 0 )
) AS `gameAlignment` ,
SUM (
IF (cp . is_active = 1 , 1 , 0 )
) AS convocatoriaTotal
FROM
game g
INNER JOIN convocatoria c ON g . id = c . game_id
INNER JOIN convocatoria_player cp ON c . id = cp . convocatoria_id
AND cp . player_id = :player_id
AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id
AND gps . seasonplayer_id = :seasonplayer_id
LEFT JOIN game_alignment 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 = 122320 AND cp . is_active = 1
LEFT JOIN game_player_statistics gps ON g . id = gps . game_id AND gps . seasonplayer_id = 125520
LEFT JOIN game_alignment ga ON ga . id = g . alignment_id AND ga . alignment LIKE '%\"id\":122320%'
WHERE
g . season_id = 27676
AND g . deleted_at IS NULL
;
Copy