标签:nal inf version 返回 where 返回结果 latest png pre
1,查询实时值,从live表中查询,tag名为Item_0
select * from live WHERE TagName = ‘Item_0‘
返回结果
2,查询历史值,从history表中查询,tag名为Item_0
select * from history WHERE TagName = ‘Item_0‘
and DateTime < ‘2021-06-04 15:00:00‘
and DateTime >= ‘2021-06-04 13:00:00‘
返回结果如下
3,向history表中插入数据,tag名为test_insert1
INSERT INSQL.Runtime.dbo.AnalogHistory
(DateTime, TagName, Value, OPCQuality, wwVersion)
VALUES(‘2021-6-4 14:05:10‘, ‘test_insert1‘, 17, 192, ‘LATEST‘)
查询一下结果
select * from history WHERE TagName = ‘test_insert1‘
and DateTime < ‘2021-06-04 15:00:00‘
and DateTime >= ‘2021-06-04 13:00:00
结果如下
标签:nal inf version 返回 where 返回结果 latest png pre
原文地址:https://www.cnblogs.com/Learntoprogram/p/14850013.html