Hi All, I am having piavg,pistd,picoutn as 3 different table and I wanted to have data for a tag from all these 3 tables within a timestamp of 10 mins.When I try to do with join then I am getting a count of 3600 but when I try to run individual query of count then I am getting 600 for timespan of 10 min . Can anyone please explain where I am getting wrong or what exactly is wrong in this case :
SELECT
a.tag,
a.time,
a.value AS AvgValue,
s.value AS StdDevValue,
c.value AS SampleCount
FROM
piarchive..piavg a
JOIN
piarchive..pistd s ON a.tag = s.tag AND a.time = s.time
JOIN
piarchive..picount c ON a.tag = c.tag AND a.time = c.time
WHERE
a.tag IN ('tagname1') AND
a.time BETWEEN '*-10m' AND '*' AND
a.timestep = '10m'
ORDER BY
a.time;