AnsweredAssumed Answered

PI OLEDB query for avg values

Question asked by oolabode on Jul 28, 2020
Latest reply on Jul 30, 2020 by oolabode

Hello Experts,


I am having an issue with a SQL query using PI OLEDB.


I have two tags, the first one has int values and the second has a string value. The timestamps are the same for both tags.


I want to get the avg value for the first tag over a period and display the corresponding string value as well.


I use something like this to get the avg value from the first tag:

select tag, time, value from [piarchive]..[piavg] where tag ='sinusoid' and time between date(?) and date(?) and timestep ='24h'and calcbasis ='eventweighted'


I am not sure how to group/join the second tag with the string values.


Can you give me some direction?