If I have a table as follows.
TagName Value Datetime
--------------------------
T1 v1 D1
T2 v2 D1
T3 v3 D1
T1 v4 D2
T2 v5 D2
T3 v6 D2
and I want to create a select query that returns the following
T1 T2 T3 Datetime
----------------------------
v1 v2 v3 d1
V4 v5 v6 d2
The T1/T2/T3 is dynamic i.e there can be any number of tags. I have the database that records the value of different tags at particular timestamp. I want the values of all the tags at one timestamp in one row. Would anybody know how to do this?