AnsweredAssumed Answered

PI SQL Commander: multi instruction query

Question asked by SalGarcia on Nov 13, 2017
Latest reply on Apr 15, 2019 by yanscote

This is perhaps a very simple question, what is the syntax to build a query with more than one instruction?

For example, while the below statement runs well:

 

SELECT time,value FROM piarchive..picomp2 

WHERE tag = 'NICE_TAG_NAME_A' AND time BETWEEN '2017-09-21 08:49:00' AND '2017-09-21 10:42:00'

 

If I try to run this query for multiple tags:

 

SELECT time,value FROM piarchive..picomp2 

WHERE tag = 'NICE_TAG_NAME_A' AND time BETWEEN '2017-09-21 08:49:00' AND '2017-09-21 10:42:00'

SELECT time,value FROM piarchive..picomp2 

WHERE tag = 'NICE_TAG_NAME_B' AND time BETWEEN '2017-09-21 08:49:00' AND '2017-09-21 10:42:00'

 

Then I get the following error:

[SQL Parser] [Line 4] Syntax error near 'SELECT'.

 

Surely there is way to do this. Thanks in advanced.

 

Outcomes