SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9446107'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9446107'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9446107'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9446114'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9446114'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9446114'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9446112'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9446112'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9446112'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9446198'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9446198'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9446198'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9436469'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9436469'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9436469'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9436726'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9436726'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9436726'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9433227'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9433227'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9433227'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9433580'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9433580'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9433580'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9433322'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9433322'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9433322'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9433125'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9433125'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9433125'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9433166'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9433166'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9433166'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9433225'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9433225'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9433225'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9433131'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9433131'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9433131'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9432961'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9432961'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9432961'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9432966'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9432966'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9432966'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9432976'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9432976'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9432976'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9432970'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9432970'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9432970'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9432955'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9432955'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9432955'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9433048'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9433048'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9433048'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9433010'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9433010'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9433010'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9429750'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9429750'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9429750'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9429761'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9429761'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9429761'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9429768'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9429768'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9429768'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
SELECT M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, M.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, T.id tournament_id
, T.idt tournament_idt
, '?' rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, T.ville tournament_city
, T.stade tournament_stadium
, T.surface tournament_surface
, T.surface_photo tournament_surface_photo
, T.surface_color tournament_surface_color
, T.monnaie tournament_currency
, T.prix tournament_prize_money
, SCO.nom_fr tournament_country
, T.logo tournament_logo
, T.debut tournament_start
, T.fin tournament_end
, T.nbj tournament_nbPlayer
, T.genre tournament_genre
, T.category tournament_category
, T.type tournament_type
, T.ids tournament_site
, T.year tournament_year
, T.importance tournament_importance
, '' team1
, '' team2
, T.importance
, T.background tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, C.nom court_name
, C.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
INNER JOIN tournois T on T.id = M.idt
INNER JOIN tournois_name N on N.id = T.id && N.cup = 0
LEFT OUTER JOIN lieux_sites SL on T.ids = SL.id
LEFT OUTER JOIN lieux_villes SC on SL.idv = SC.id
LEFT OUTER JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT OUTER JOIN `livescores_new`.`matchs` LS on LS.tt_match_id = M.id
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts C on C.ids = S.ids && C.ordre = S.court
WHERE
M.id = '9429788'
&& M.type_tournoi_add = 0
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, CR.niveau level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, C.id tournament_id
, C.parent tournament_idt
, CR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, CONCAT(CR.equipe_domicile, '|', CR.equipe_exterieur) tournament_city
, '' tournament_stadium
, CR.surface tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, CR.date_d tournament_start
, '' tournament_end
, C.nbj tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, CR.lieu tournament_site
, '' tournament_year
, 65 tournament_importance
, IF(T1.nom_fr, T1.nom_fr, CR.equipe_domicile) team1
, IF(T2.nom_fr, T1.nom_fr, CR.equipe_exterieur) team2
, 65 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
INNER JOIN joueurs P1 on P1.id = M.j1
LEFT OUTER JOIN `joueurs` P1B on P1B.id = M.j1_bis
INNER JOIN joueurs P2 on P2.id = M.j2
LEFT OUTER JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT OUTER JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT OUTER JOIN tournois_programmes S on S.idm = M.id
LEFT OUTER JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
INNER JOIN `coupes_rencontres` CR on CR.id = M.idt
INNER JOIN `coupes` C on C.id = CR.coupe_id
INNER JOIN tournois_name N on N.id = C.id
LEFT JOIN lieux_sites SL on SL.id = CR.lieu
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
LEFT JOIN `lieux_pays` T1 ON (T1.code = CR.equipe_domicile)
LEFT JOIN `lieux_pays` T2 ON (T2.code = CR.equipe_exterieur)
WHERE
M.id = '9429788'
&& M.type_tournoi_add = 1
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
UNION
SELECT
M.*
, M.time_start time_start
, M.time time_end
, M.duration_pause
, M.type_match_add type_match
, M.type_tournoi_add type_tournament
, '' level
, M.qualif
, M.idw winner_id
, P1.id p1_id
, P1.nom p1_name
, P1.prenom p1_first_name
, P1.name_zh p1_name_zh
, P1.birthday p1_birthday
, P1.sexe p1_gender
, P1.nat p1_nat
, P1.photo p1_photo
, P1.taille p1_height
, P1.poids p1_weight
, R1.rank p1_rank
, R1.liveRank p1_rank_live
, P1.pro_depuis p1_turn_pro
, '?' p1_best_rank
, P1.prise p1_forehand
, P1.revers p1_backhand
, M.ts1 p1_seed
, P1B.id p1b_id
, P1B.nom p1b_name
, P1B.prenom p1b_first_name
, P1B.name_zh p1b_name_zh
, P1B.birthday p1b_birthday
, P1B.sexe p1b_gender
, P1B.nat p1b_nat
, P1B.photo p1b_photo
, P1B.taille p1b_height
, P1B.poids p1b_weight
, R1B.rank p1b_rank
, R1B.liveRank p1b_rank_live
, P1B.pro_depuis p1b_turn_pro
, P2.id p2_id
, P2.nom p2_name
, P2.prenom p2_first_name
, P2.name_zh p2_name_zh
, P2.birthday p2_birthday
, P2.sexe p2_gender
, P2.nat p2_nat
, P2.photo p2_photo
, P2.taille p2_height
, P2.poids p2_weight
, R2.rank p2_rank
, R2.liveRank p2_rank_live
, P2.pro_depuis p2_turn_pro
, '?' p2_best_rank
, P2.prise p2_forehand
, P2.revers p2_backhand
, M.ts2 p2_seed
, P2B.id p2b_id
, P2B.nom p2b_name
, P2B.prenom p2b_first_name
, P2B.name_zh p2b_name_zh
, P2B.birthday p2b_birthday
, P2B.sexe p2b_gender
, P2B.nat p2b_nat
, P2B.photo p2b_photo
, P2B.taille p2b_height
, P2B.poids p2b_weight
, R2B.rank p2b_rank
, R2B.liveRank p2b_rank_live
, P2B.pro_depuis p2b_turn_pro
, L.id tournament_id
, 0 tournament_idt
, LR.id rencontre_id
, N.name_fr tournament_name_fr
, N.name_en tournament_name_en
, N.name_zh tournament_name_zh
, N.name_de tournament_name_de
, N.name_es tournament_name_es
, SC.nom tournament_city
, '' tournament_stadium
, '3' tournament_surface
, '' tournament_surface_photo
, '0' tournament_surface_color
, '' tournament_currency
, '' tournament_prize_money
, SCO.nom_fr tournament_country
, '' tournament_logo
, L.time_start tournament_start
, '' tournament_end
, '' tournament_nbPlayer
, '' tournament_genre
, '' tournament_category
, '' tournament_type
, LR.site tournament_site
, L.year tournament_year
, 0 tournament_importance
, '' team1
, '' team2
, 3 importance
, '' tournament_background
, SC.fuseau_horaire
, IF(ISNULL(LS.status) || M.status = 2 || M.status = 3 || M.status = 4, M.status, LS.status) match_status
, LS.serve
, S.time s_time_start
, S.court
, S.date_loc
, S.type s_type
, S.ordre s_order
, CT.nom court_name
, CT.ordre court_order
FROM
tournois_matchs M
JOIN joueurs P1 on P1.id = M.j1
LEFT JOIN `joueurs` P1B on P1B.id = M.j1_bis
JOIN joueurs P2 on P2.id = M.j2
LEFT JOIN `joueurs` P2B on P2B.id = M.j2_bis
LEFT JOIN tennis_rankings R1 on R1.player = P1.id AND R1.id = IF(P1.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R1B on R1B.player = P1B.id AND R1B.id = IF(P1B.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2 on R2.player = P2.id AND R2.id = IF(P2.sexe = 1, 'wta', 'atp')
LEFT JOIN tennis_rankings R2B on R2B.player = P2B.id AND R2B.id = IF(P2B.sexe = 1, 'wta', 'atp')
LEFT JOIN `livescores_new`.`matchs` LS ON (LS.tt_match_id = M.id)
LEFT JOIN tournois_programmes S on S.idm = M.id
LEFT JOIN lieux_courts CT on (CT.ids = S.ids && CT.ordre = S.court)
JOIN `leagues_rounds` LR on LR.id = M.league_round
JOIN `leagues` L on L.id = LR.league
JOIN tournois_name N on N.league = L.id
LEFT JOIN lieux_sites SL on SL.id = LR.site
LEFT JOIN lieux_villes SC on SC.id = SL.idv
LEFT JOIN lieux_pays SCO on SCO.code = SC.pays
WHERE
M.id = '9429788'
&& M.type_tournoi_add = 2
&& (S.statut = 0 || S.statut = 4 || S.statut = 2 || ISNULL(S.statut))
LIMIT 1
앙제 WTA 125: 페로, 16강 진출 성공; 폰셰, 첫 경기에서 패배
앙제 WTA 125 대회에서 이른 오후 두 명의 프랑스 선수가 코트에 섰습니다. 현재 세계 랭킹 422위인 피오나 페로는 세계 랭킹 316위의 호주 선수 티나 스미스와 맞섰습니다.
메인에루아르 주에서 열린 이 대회에 초청받은 28세의 선수는 경기 초반 잘 풀리지 않았지만, 적절한 페이스를 찾아내며 3세트(3-6, 6-4, 6-0, 2시간 5분) 만에 승리...
플리스코바의 성공적인 복귀: 전 세계 1위, 포르투갈에서 컴백 신호탄
1년 이상의 공백 후, 카롤리나 플리스코바는 포르투갈에서 코트로 복귀하며 승리를 거뒀다. 그녀의 목표는 서서히 감각을 되찾고 최고의 수준으로 복귀하는 것이다.
작년 US 오픈 2라운드에서 발목 부상으로 인해 첫 서브 게임에서 포기할 수밖에 없었던 플리스코바를 떠올렸었다.
그 이후로, 전 세계 1위였던 그녀는 두 차례의 발 수술을 받고 대회 복귀를 위해 ...
US 오픈 예선: 폰셰 탈락, 그라체바만 유일한 생존자
이번 목요일, US 오픈 예선 2라운드에 4명의 프랑스 선수들이 출전했습니다. 6번 시드인 바르바라 그라체바는 타라 위어스를 상대로 7-5, 6-2로 승리했습니다.
프랑스 선수는 본선 진출을 위해 에나 시바하라와 맞붙을 예정입니다. 제시카 폰셰는 린다 클리모비코바에게 6-3, 6-3으로 패했습니다. 마농 레오나르드는 판나 우드바르디에게 6-2, 6-1로 ...
----
US Open 예선 경기들, 비로 인해 목요일로 연기
뉴욕과 플러싱 메도우스 경기장에는 하루가 시작된 이후로 비가 그치지 않고 내리고 있습니다.
2차 예선 경기 중 단 한 경기도 완료되지 못했으며, 매우 빡빡한 일정으로 인해 주최측은 모든 경기를 내일로 연기하기로 결정했습니다.
네 명의 프랑스 선수들이 비로 경기가 중단되기 전 경기를 시작했습니다: 위...
US 오픈 예선: 에르베르 탈락, 폰셰와 드로게 진출
이번 주 월요일, US 오픈 예선 1라운드가 마무리되었습니다. 남자 부문에서는 키리앙 자케와 티투안 드로게가 각각 리암 드랙슬과 알리벡 카치마조프(기권)를 상대로 승리하며 본선에 진출했습니다.
피에르 위그 에르베르는 엔리케 로차에게 3세트 접전 끝에 패배했습니다. 루카 파블로비치도 레안드로 리디에게, 아르튀르 부키에는 좀보르 피로스에게 각각 패했습니다.
...
프라하 WTA 250 토너먼트 8강에서 발렌토바에게 패배한 퐁셰
프라하 WTA 250 토너먼트에 참가한 마지막 프랑스 선수인 제시카 퐁셰(28세)가 이번 목요일 첫 경기를 가졌습니다. 18세의 테레자 발렌토바(WTA 랭킹 106위)와 맞붙은 28세의 프랑스 선수는 4강 진출을 바라고 있었습니다.
그녀는 경기 시작부터 안정적인 모습을 보였으며, 9분 만에 첫 세트에서 2-0으로 앞서 나갔습니다. 그러나 바로 그 순간...