我有下表:idtimetextotheridentifier-------------------------------------------16apple427orange438banana349pear3510grape2我想要做的是选择3个最近的记录(按时间降序),它们的otheridentifier是不同的。所以在这种情况下,结果将是id的:5、4和2。id=3将被跳过,因为有一个更新的记录具有相同的otheridentifier字段。这是我尝试做的:SELECT*FROM`table`GROUPBY(`otheridentifier`)ORDERBY`time`DESCL
我有下表:idtimetextotheridentifier-------------------------------------------16apple427orange438banana349pear3510grape2我想要做的是选择3个最近的记录(按时间降序),它们的otheridentifier是不同的。所以在这种情况下,结果将是id的:5、4和2。id=3将被跳过,因为有一个更新的记录具有相同的otheridentifier字段。这是我尝试做的:SELECT*FROM`table`GROUPBY(`otheridentifier`)ORDERBY`time`DESCL