15-06-2008, 02:45 PM
Voilà une requête qui récupérera exactement ce que tu veux sauf que perso je comprends pas l'utilité de vouloir une ligne au lieu de trois
Code :
SELECT ID_Joueur, ID_colonie AS idC , nom,
(SELECT ID_ressource from colonie_ressources WHERE ID_colonie = idC AND ID_ressource=1) AS ID_Nourriture,
(SELECT nombre from colonie_ressources WHERE ID_colonie = idC AND ID_ressource=1) AS Nb_Nourriture,
(SELECT ID_ressource from colonie_ressources WHERE ID_colonie = idC AND ID_ressource=2) AS ID_Bois,
(SELECT nombre from colonie_ressources WHERE ID_colonie = idC AND ID_ressource=2) AS Bois,
(SELECT ID_ressource from colonie_ressources WHERE ID_colonie = idC AND ID_ressource=3) AS ID_Briques,
(SELECT nombre from colonie_ressources WHERE ID_colonie = idC AND ID_ressource=3) AS Briques
FROM colonie
WHERE ID_Joueur=9