AnsweredAssumed Answered

PI SQL

Question asked by strike2 on Jan 30, 2020
Latest reply on Jan 31, 2020 by Asle Frantzen

Hi Folks,

I am new to PI SQL and have been working with PI System Explorer.  I am having trouble writing the correct query to return the result set that I want from PI AF and PI.  I have Googled and searched through this forum without success, so any help would be appreciated.  My current text query is below, and I have also included below screenshots of my environment and desired result.

Thank you for your assistance!

Ken

 

My current text query:

SELECT eh.name, ea.name
FROM  

      [PI System Monitoring].[Asset].[ElementHierarchy] eh
      INNER JOIN [PI System Monitoring].[Asset].[ElementAttribute] ea
           ON ea.ElementID = eh.ElementID
WHERE
                eh.Path = N'\PI Interfaces\Waste\Arlington WRF\'
        AND ea.name LIKE '%Display Tag%'
ORDER BY eh.name, ea.Name
OPTION (FORCE ORDER)

 

My PI System Explorer screenshot :

PI System Explorer AF dB

My current PI SQL result set screenshot:

PI SQL Query

I would like to modify my query to return a result set like this:

PI SQL Wanted Result Set

Thanks!

Outcomes