update a set next_time=(select min(login_time) from tb where uid=a.uid and login_time>a.login_time) from tb a
update SourceDB.dbo.gm_campaign2 set next_time=(select MAX(login_time) from SourceDB.dbo.gm_campaign2 where login_userid=19816200) where login_userid=19816200
from tb a