SELECT users.name, fotos.id AS aktuellstes_foto FROM users LEFT JOIN fotos ON fotos.user = users.name ORDER BY users.datum DESC LIMIT 3,40