CREATE TEMPORARY TABLE t (
id INT AUTO_INCREMENT NOT NULL, # this is the secret sauce
location VARCHAR(11) NOT NULL,
time TIME NULL,
PRIMARY KEY (id) );
INSERT INTO t (location, time)
SELECT location, time FROM tbl
WHERE person = 'P1'
ORDER BY time;
INSERT INTO t ('', NULL); # Could use NOW() or whatever
Now you have an ordered list of info about the person, including a dummy row for the end. How do a self-join to get the desired pairings.
SELECT a.location,
a.time AS Start_Time,
b.time AS End_Time
FROM t a, t b
WHERE b.id = a.id+1
ORDER BY a.time;
I see that this is not what you wanted, since you seem to have both start and end times mixed in the 'time' column, with no indication of which is which. But maybe I have helped you think "out of the box".