22,209
社区成员
发帖
与我相关
我的任务
分享
with t1 as
(
SELECT TOP 1 TAV
FROM Tin_FengXiangYuan order by 时间 desc
),
t2 as
(
SELECT TOP 1 TAV
FROM Tin_YiPinYuan order by 时间 desc
)
update ATable_Output set TinAV= t1.TAV from t1 where ATable_Output.StationID=0
update ATable_Output set TinAV= t2.TAV from t2 where ATable_Output.StationID=1
update test1 set test1.shl=t2.shl from
(select test2.shl,test2.id from test2,test1 where test2.id=test1.id)t2
where test1.id=t2.id
给你参考with t1 as
(
SELECT TOP 1 TAV
FROM Tin_FengXiangYuan order by 时间 desc
),
update ATable_Output set TinAV= t1.TAV from t1 where ATable_Output.StationID=0
;with t2 as
(
SELECT TOP 1 TAV
FROM Tin_YiPinYuan order by 时间 desc
)
update ATable_Output set TinAV= t2.TAV from t2 where ATable_Output.StationID=1