Bonjour,
j'ai une table fiche et une table contrat :
Actuellement, je fais la requête suivante :fiche
-------------
id_fiche
nom_demandeur
designation
contrat
-------------
id
id_fiche
nom
montant
j'obtiens ce résultat :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 SELECT `fiche`.id_fiche, `fiche`.nom_demandeur, `fiche`.designation, `contrat`.nom As nom_contrat, `contrat`.montant FROM `fiche` INNER JOIN `contrat` ON `fiche`.id_fiche = `contrat`.id_fiche
mais en fait, je voudrais plutôt avoir ceci :id_fiche | nom_demandeur | designation | nom_contrat | montant |
1012541 | the demandeur | la designation | contrat1 | 1000 |
1012541 | the demandeur | la designation | contrat2 | 3000 |
mais je ne sais pas comment faire!id_fiche | nom_demandeur | designation | contrat1 | contrat2 |
1012541 | the demandeur | la designation | 1000 | 3000 |
Partager