1 Eintrag, 1 Seite |
SELECT users.name, (SELECT MAX(id) FROM photos WHERE user_id = a.user_id) AS letztes_foto FROM users, photos WHERE photos.user_id = users.user_id GROUP BY users.name
SELECT users.name, (SELECT id FROM photos WHERE user_id = a.user_id ORDER BY datum DESC LIMIT 1) AS letztes_foto FROM users, photos WHERE photos.user_id = users.user_id GROUP BY users.name
SELECT users.name, (SELECT id FROM photos WHERE user_id = a.user_id ORDER BY datum DESC LIMIT 1) AS letztes_foto FROM users, photos LIMIT 10
1 Eintrag, 1 Seite |