AnsweredAssumed Answered

PI ODBC - How to query a GROUP BY clause?

Question asked by erielias on Jan 6, 2015
Latest reply on Jan 6, 2015 by lmlcoch

Hi everyone!

 

We have a ODBC connection with PI and we need to build a query using a GROUP BY clause.

This is the example:

 

select
        day(time) -1 as dia, max(value) as prod_real
    from
        picomp
    where
        tag = 'LPBQ1.Producao_Toneladas_Diario'
        and year(time) = year('t')
        and month(time) = month('t')
        and day(time) > 1

        and hour(time) < 1
    group by day(time) -1

 

When we take off the GROUP BY clause it works.

 

Thanks!

 

Eri

Outcomes