Currently using PI SQL Commander 2021 with the RTPQ engine. (Really loving the performance increase switching from PI OLEDB to PI SQL Client.) I created a view to contain all static attributes. I created a Table-Valued Function to contain data that can be interpolated. Using a "Cross Apply" works great retrieving the desired data.
SELECT e.[Name], e.[Static Attribute 1], e.[Static Attribute 2], e.[Static Attribute 13], s.[TimeStamp], s.[Interpolated value 1], s.[Interpolated value 2], s.[Interpolated value 3]
FROM[Master].[Element].[DeviceX ] e
CROSSAPPLY[Master].[Element].[DeviceX_GetSampledValues]
(
e.ID,--Element ID
'y',--Start Time
't',--End Time
'1h'--Time Step
) s
Now I want to add data that should not be interpolated but should be "At or Before" such as discrete values. Suggestions please.