Edit
I have two tables : etape and etapex.
I need to find the maximum idProjet
for each idEtape
(in table etapex), and there link the idEtape
and idProjet
to 'nomEtapeand
livrable` from the table etape.
So I tried two different things :
SELECT etapexprojet.idEtape, idProjet, nometape, livrable
FROM etape, etapexprojet
WHERE etapexprojet.idetape = (SELECT MAX(etape.idetape) FROM etapexprojet )
Unfortunately, this is what I get :
Here's my other "solution":
The first step is to find the max value (I don't want to use group by) :
SELECT EX.idEtape
FROM etapexprojet EX
LEFT JOIN etapexprojet EX2
ON EX.idprojet = EX2.idprojet
AND EX.idetape < EX2.idetape
WHERE EX2.idetape IS NULL
But now I'm stuck, and I don't get how to join what I get from that first request to the table etape.
At the end, it should give me something like :
But with the columns nomEtape
and livrable
as well...
Thanks in advance for your help !