好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Historian数据库中sql查询数据的方法

  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   

查看更多关于Historian数据库中sql查询数据的方法的详细内容...

  阅读:25次