I have a sql request like that :
SELECT *, MAX(dateFin)
FROM t1 LEFT JOIN
t2
ON t1.id = t2.idUtl
GROUP BY t2.dateFin
ORDER BY t1.dateCreation
limit 0,10
I have this tables :
t1 t2
id dateCreation id idUtl dateFin
1 2015-02-25 1 1 2015-01-10
2 2015-02-22 2 1 2014-09-12
3 2015-06-20 3 3 2014-08-23
So with my request i have this result:
t1.id dateCreation t2.id idUtl dateFin
3 2015-06-20 3 3 2014-08-23
1 2015-01-10 1 1 2015-01-10
My problem is that i also want this line
t1.id dateCreation t2.id idUtl dateFin
2 2015-02-22 NULL NULL NULL
I try something with another SELECT in my request but it didn't work and i don't think it's a really good idea.