Comparison with numeric values
- Last UpdatedJan 04, 2023
- 1 minute read
- PI System
- PI SQL Client ODBC 2021
- Developer
Comparison with numeric values causes post-processing, so the query execution is slowed down.
For example:
SELECT e."Name" Element, ea."Name" Attribute,
ea."Value", ea."Value_Double"
FROM Element.Element2@pi e
INNER JOIN Element.Attribute2@pi ea ON ea."ElementID" = e.ID
WHERE e."Name" = 'Houston'
AND (ea."Name" = 'Environment' OR ea."Name" Like 'Plant%')
AND ea."Value" > 50
ORDER BY e."Name", ea."Name";
As long as the intermediate result contains only numeric data for the value column, post-processing will generate correct results. However, if there are non-numeric strings in the intermediate result, post-processing will generate an error message.