IN clause limitations
- Last UpdatedApr 24, 2025
- 1 minute read
If you are querying analog, discrete, or string tags from the AnalogTag, DiscreteTag, or StringTag tables (respectively), you cannot use the LIKE clause within an IN clause to condition the tagname unless you are returning the vValue column. This restriction applies if you are using the four-part naming convention or an extension table view.
For example:
SELECT TagName, vValue, Quality, QualityDetail
FROM History
WHERE TagName IN (SELECT TagName FROM StringTag WHERE TagName LIKE 'SysString')
AND DateTime >='2001-06-21 16:00:00.000'
AND DateTime <='2001-06-21 16:40:00.000'
However, it is more efficient to use an INNER REMOTE JOIN to achieve the same results. For more information, see -old-Using an INNER REMOTE JOIN.