Essaye quelque chose comme ca:
Select a.label, d.fname, d.lname, c.DATE
FROM hardwares a
LEFT JOIN (SELECT MAX(DATE), id_hardware FROM assignments GROUP BY id_hardware) b ON b.id_hardware = a.id_hardware
LEFT JOIN assignments c on c.id_hardware = b.id_hardware and c.DATE = b.DATE
LEFT JOIN users d on d.id_user = c.id_user
Message édité par Oliiii le 21-03-2012 à 09:00:05