2 Replies Latest reply on Nov 13, 2017 9:12 PM by vkaufmann

    PI SQL Commander: multi instruction query

    SalGarcia

      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.