I have problems with creating more complex query for Reletional Datasets.
I want to compare one set of PI points with other (density for storage tanks).
One set is naming like 'RT%D15.PV', and other 'RT%.D15.LA'
Values must be the same, but in some cases there is a difference.
I want to see on which pair of tags is difference in value or timestamp.
Here is my example, but I would different...
SELECT s.tag,d.descriptor, value, time, case when status = 0 THEN 'OK' ELSE 'BAD' END as status
FROM [piarchive].[pisnapshot] s
inner JOIN [pipoint].[classic] d ON s.tag = d.tag
WHERE s.tag LIKE 'RT%D15.PV' or s.tag LIKE 'RT%.D15.LA'
In this case, columns in table are:
How to create query with this columns in table:
tag1 ('RT%D15.PV' )
status (“BAD” if value1 <> value2 or “OK” if value1 = value2)