What my data looks like:
It's 5 data points made at the same time. I want to combine all five into one row.
I tried using the following query:
SELECT
DateAndTime as Time,
(SELECT Val WHERE TagIndex = 0) as Normalized_Vac,
(SELECT Val WHERE TagIndex = 1) as Avgerage_Vac,
(SELECT Val WHERE TagIndex = 2) as RAL_ACT,
(SELECT Val WHERE TagIndex = 3) as RAL_CMD,
(SELECT Val WHERE TagIndex = 4) as PPH_weight
FROM
Line_32_floats
GROUP BY
DateAndTime;
but I get the error:
Column 'Line_32_floats.TagIndex' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.