I have the following query
SELECT tagindex, AVG(val) from floatTable
WHERE tagindex IN(828,856,883,910)
AND DateAndTime > DATEADD(HH,-1,GETDATE())
AND DateAndTime < DATEADD(HH,-2,GETDATE())
group by tagindex
It returns the following:
828 1
856 1
883 1
910 1
How can I return a single result where it is the combined average of all the rows?