0

ODBC Driver - Auto Pivot Option

Is it possible to add a feature in Canary ODBC driver that automaticly pivots the tag names to columns.

See the SQL PIVOT below.

SELECT * FROM (

SELECT tag_name, time_stamp, value as value FROM openquery(CANARY,

          'select tag_name, time_stamp, value from data

          where tag_name in (''TAG1.Sts.Value'', ''TAG2.Sts.Value'')

          and aggregate_id=''TimeAverage2''

                and aggregate_interval=''01:00:00''')

) c

       PIVOT (

    MAX(value)

    FOR tag_name IN ([TAG1.Sts.Value], [TAG2i.Sts.Value])

) AS P

Reply

null

Content aside

print this pagePrint this page
  • 1 yr agoLast active
  • 87Views
  • 1 Following