时间:2021-07-01 10:21:17 帮助过:17人阅读
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
结果如下
Historian数据库中sql查询数据的方法
标签:nal inf version 返回 where 返回结果 latest png pre