How to get the ID of Query I have this table

CREATE TABLE `LastPosition` (
`Id` CHAR(36) COLLATE utf8_bin NOT NULL DEFAULT '',
`Serial` BIGINT(20) NOT NULL,
`DateGps` DATETIME NOT NULL,
PRIMARY KEY USING BTREE (`Id`, `DateGps`),
KEY `serial_idx` USING BTREE (`Serial`),
KEY `dategps_idx` USING BTREE (`DateGps`),
) ENGINE=InnoDB
ROW_FORMAT=DYNAMIC CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';


And this query

SELECT
    Serial,
    MAX(DateGps) AS maxi
FROM
    LastPosition
GROUP BY
    Serial
ORDER BY 
    DateGps


How can I get the id of the record with the max of DateGPS?
Keep in mind that you could get more than 1 row just in case there are two or more records with the same DateGps.

SELECT lp.Id
FROM   LastPosition lp
JOIN   (SELECT  Serial,
                MAX(DateGps) AS maxi
        FROM    LastPosition
        GROUP BY Serial) t1
ON      lp.Serial = t1.Serial
AND     lp.DateGps = t1.maxi;