AnsweredAssumed Answered

How to read data from PI Archive using JDBC?

Question asked by rama.commuri on Jan 13, 2015
Latest reply on Jan 13, 2015 by Eugene Lee

Hi

 

I want to read the data for a tag between two dates with given interval using JDBC. What will be the SELECT statement?

 

I am using the following statement to get data between two dates.

 

SELECT * FROM PIcomp2 where tag='TAG1' and time between '2015-01-07 13:00:00' AND '2015-01-08 05:30:00.

 

But i want to read data between given dates along with specified interval such as 5 minute or 10 minute interval.

 

My expected output will be

 

TAG     TIME                              VALUE

===============================

TAG1 2015-01-07 13:00:00      55

TAG1 2015-01-07 13:05:00      45

TAG1 2015-01-07 13:10:00      25

TAG1 2015-01-07 13:15:00      65

TAG1 2015-01-07 13:20:00      87

....

....

 

For that purpose how to write PI SQL SELECT  statement.

 

Thanks in advance

Outcomes