数据库语句总结

来源:互联网 发布:贪心算法的时间复杂度 编辑:程序博客网 时间:2024/06/05 18:32

将不同基站最后一条记录endtime为null的更改成endtime = getdate()


update hstnlinklog set endtime = getdate()
from
(select nodeid,max(begintime) as begintime from hstnlinklog where endtime is null  group by nodeid) as t1 where hstnlinklog.begintime = t1.begintime and hstnlinklog.nodeid = t1.nodeid

原创粉丝点击