I am querying a database containing two tables (Datalog_Descriptors and Datalog_Values) these two tables share unique ID for the data records
"Datalog_ID". Datalog_Descriptors contains narrative values while Datalog_Values contains all records for several "Datalog_ID" with a timestamp.
I use this query to retrieve data for 1/4 hour selecting a set of Datalogs that share a common feature "No 02 AHU109_Ctrls". (There are 16 of this Datalogs. There are more "Datalog_Descriptors.UCxx_Name" that I'd like to query. The final user doesn't know a priori how many datalogs these descriptors refer to).
SELECT Datalog_Values.Time, Datalog_Values.Value, Datalog_Descriptors.Datalog_Name
FROM Datalog_Descriptors, Datalog_Values
WHERE Datalog_Values.Datalog_ID = Datalog_Descriptors.Datalog_ID
AND Datalog_Descriptors.UCxx_Name = 'No 02 AHU109_Ctrls'
AND Datalog_Values.Time between "2013-01-01 11:00:00" and "2013-01-01 11:15:00"
There result is a list like this (organized by Datalog_Name):
I would like to have a table ordered by timestep and any of the Datalog_Name organized by columns, the resulting table will look like this.
Note that there is no previous knowledge of timestamps distribution (Some datalogs send values at regular intervals but others will log values log values at anytime) Is it possible with MySql or would it become not feasible?
Thanks! Luis