id date panaid
5 1332533806 14
543 1332533943 16
322 1332533825 29

anyone have simple idea to select by date next row?
if true then give next id