If your time for each ID number is unique, this will work.
SELECT d.id, d.field,d.time FROM dd JOIN ( SELECT max(d.time)m, d.id FROM d JOIN ( SELECT max(time) m, id FROM d GROUP BY id )e ON d.id=e.id AND em>d.time GROUP BY d.id )e ON d.time >= em AND d.id = e.id
Here's how it works. This subquery receives the latest time for each identifier.
SELECT max(time) m, id FROM d GROUP BY id
Then, in turn, it is nested in this request, which gives you the second-highest time for each identifier (the last time is a subset of the rows that excludes the most recent time).
SELECT max(d.time)m, d.id FROM d JOIN ( SELECT max(time) m, id FROM d GROUP BY id )e ON d.id=e.id AND em > d.time
Finally, the full query (shown above) receives all rows with a time greater than or equal to the second last time.
If your times are not unique, that is, you have several lines where the identical identifier and time are displayed, you can get more than two lines for each identifier. But you always get the last two times.
If a particular identifier has only one line, you will not receive it.
Only you know if these restrictions are acceptable.
Go violin! http://sqlfiddle.com/#!2/82719/5/0