SELECT * FROM ( SELECT * FROM tiet_user_settings AS us WHERE us.userId = ? ORDER BY created DESC ) AS tmp GROUP BY settingId