它不会返回您期望的结果,因为分组是在排序之前发生的,这从子句在SQL语句中的位置反映出来。不幸的是,您将不得不变得更加幻想才能获得想要的行。尝试这个:
SELECt *FROM `table`WHERe `id` = ( SELECt `id` FROM `table` as `alt` WHERe `alt`.`otheridentifier` = `table`.`otheridentifier` ORDER BY `time` DESC LIMIT 1)ORDER BY `time` DESCLIMIT 3



