je veux afficher les matchs avec le nom des joueurs (et pas leur id ;-) !!!) donc je fais :
select matchs.id, matchs.idjoueur1, joueur1.nom, matchs.idjoueur2, joueur2.nom
FROM matchs, joueur as joueur1, joueur as joueur2
where
joueur2.id=matchs.idjoueur2 and
joueur1.id=matchs.idjoueur1
order by ID
il il m'affiche TOUJOURS le nom du Joueur1 sur les 2 colonnes !!!!!!!
J'utilise MySQL comme base, mais ca ne devrait pas poser de problèmes non ?
cs_vagabon
Messages postés31Date d'inscriptionlundi 4 novembre 2002StatutMembreDernière intervention13 juin 2003 2 déc. 2002 à 17:17
J'ai trouvé !!! :
select matchs.id, matchs.idjoueur1, joueur1.nom as NOM1, matchs.idjoueur2, joueur2.nom as NOM2
FROM matchs, joueur1 joueur, joueur2 joueur
where
joueur2.id=matchs.idjoueur2 and
joueur1.id=matchs.idjoueur1
order by ID