1 Reply Latest reply on Mar 12, 2018 2:46 PM by Steven Hawkins

    I am trying to use LEAD in teiid, but its getting error

    Thiru A Newbie

      Below query getting error, can you please help me fix the below error,

      or

      How can achieve SQL server LEAD functionality in Teiid ?

       

      SELECT

           PI.tag,

           PI."time" AS STARTTIME,

           LEAD(PI."time") over ( order by PI."time") AS ENDTIME,

            DIGSTRING(CONVERT(PI.status,INTEGER)) AS ICV_STATE_VALUE

      FROM "piarchive"."picomp" PI

      WHERE

           PI.tag = 'BA:ACTIVE.1'  AND

           PI.time BETWEEN '2018-02-28' AND '2018-03-01'

       

      Error: TEIID30068 Remote org.teiid.api.exception.query.QueryResolverException: TEIID30068 The function 'LEAD(ALL PI."time")' is an unknown form.  Check that the function name and number of arguments is correct.

      SQLState:  50000

      ErrorCode: 30068