i think thats a bit complicated...
if your 3rd column is the name and you want to find the difference between
the last entry and the new one ...
to find out the last date and the date before that, you may have to do this:
SELECT timestamp FROM xxx WHERE name='A' ORDER BY timestamp LIMIT 2
now you need a query that really "calculates" these timestamps for name='A'
( may look a bit complicated and unnecessary, but i think min/max and limit is not
working as desired )
SELECT TIMEDIFF( MAX(timestamp) - MIN(xxx.timestamp) ) AS timediff
FROM xxx
WHERE name='A'
AND timestamp IN
(
SELECT timestamp
FROM xxx
WHERE name='A'
ORDER BY timestamp
LIMIT 2
)
that should do the trick...i guess