Testa med den här:
SELECT
ID,
`time` AS time1,
(SELECT MIN(st.`time`) FROM T1 st WHERE st.ID = T1.ID AND st.`time` > T1.`time`) AS time2
FROM T1
Testa med den här:
SELECT
ID,
`time` AS time1,
(SELECT MIN(st.`time`) FROM T1 st WHERE st.ID = T1.ID AND st.`time` > T1.`time`) AS time2
FROM T1