cs_cy4nur3
Messages postés17Date d'inscriptionmardi 3 mai 2005StatutMembreDernière intervention27 mai 2010
-
26 mai 2010 à 15:34
cs_cy4nur3
Messages postés17Date d'inscriptionmardi 3 mai 2005StatutMembreDernière intervention27 mai 2010
-
27 mai 2010 à 09:06
Bonjour a vous,
voila j'ai un soucis. j'ai deux tables et je voudrais obtenir qu'un seul tableau
voici la premiere table:
et moi ce que je voudrais obtenir c'est un tableau sous la forme:
joueur1_____point1____joueur2____point2 ___ronde__tournois
.
.
.
et la liste de ce que je demande.
j'ai fait un requete mais elle ne ne fonctionne pas(resultat pas correct). Merci de m'aider.
Voici la requete:
SELECT joueur_1.joueur_id, joueur_1.point, joueur_2.joueur_id, joueur_2.point
FROM joueur_1, joueur_2
WHERE joueur_1.tournois_id = joueur_2.tournois_id
AND joueur_1.ronde = joueur_2.ronde
AND joueur_1.tournois_id =1
AND joueur_1.ronde =1
cs_cy4nur3
Messages postés17Date d'inscriptionmardi 3 mai 2005StatutMembreDernière intervention27 mai 2010 27 mai 2010 à 09:06
solution:
SELECT j1.joueur_id AS joueur1, j1.point AS point1, j2.joueur_id AS joueur2, j2.point AS point2, j1.ronde AS ronde, j1.tournois_id AS tournois
FROM joueur_1 AS j1
JOIN joueur_2 AS j2 ON j2.ronde = j1.ronde
AND j2.tournois_id = j1.tournois_id
AND j2.table = j1.table