AnsweredAssumed Answered

What is the most efficient query to determine the last time a tag had a GOOD value using PI OLEDB?

Question asked by jeff_denz on Mar 18, 2015
Latest reply on Apr 9, 2015 by aseck

Problem: Determine the last time a tag had a GOOD value using PI OLEDB.  The point has many records (millions).

 

One query that works for tags that do not have many archived data points is:

SELECT max(time) as TimeofLastGoodValue FROM piarchive.picomp2 WHERE tag = 'tagXYZ' and status = 0

 

I need a query that can more efficiently zero in on when a tag was last in good status.

Outcomes