Jemand zu Hause?Leser: 17
1
2
3
SELECT * FROM (
SELECT * FROM tiet_user_settings AS us WHERE us.userId = ? ORDER BY created DESC
) AS tmp GROUP BY settingId
1
2
3
4
5
6
7
SELECT *
FROM tiet_user_settings
INNER JOIN (SELECT userId, settingId, MAX(created) AS created
FROM tiet_user_settings
GROUP BY userId, settingId)
USING (userId, settingId, created)
WHERE userId = ?;
Wie frage ich & perlintro
brian's Leitfaden für jedes Perl-Problem