我正在尝试返回具有与最新时间戳记关联的笔记的任务。尽管此查询有效,但它并不会始终返回最新的时间戳。还有另一种方法来做到这一点?Mysql - 最近的时间戳记多个记录
SELECT DISTINCT tasks.TaskID, tasks.desc, tasks.startdate, tasks.active, notes.note, max(notes.NoteDate)
FROM tasks INNER JOIN notes ON tasks.TaskID=notes.NoteID
WHERE notes.NoteDate >= curdate()
GROUP BY tasks.TaskID
可能重复[获取具有最大值列的行](http://stackoverflow.com/questions/121387/fetch-the-row-which-has-the-max-value-for-a-column) – Barmar 2013-04-30 16:37:36