没别的啥,就是想写个sql语句
sql语句:
select * from
(select nodeId,max(UpdateTime)as UpdateTime
from JT_InspectNode_Update
where PathID in (1, 2)
and deltag = 0
and UpdateTime <=
(select MAX(UpdateTime)as UpdateTime
from JT_InspectNode_Update
where UpdateTime <= '2017-07-24 11:51:30')
group by nodeId) as t1,
(select * from JT_InspectNode_Update where PathID in (1,2) and deltag = 0)as t2
where t1.NodeId = t2.NodeId and t1.UpdateTime = t2.UpdateTime order by t2.NodeId