consolidated result columns
Hi everyone,
I need help with a query.
I have a table that looks like this:
devvloc - varchar50
timest - datetime
value - decimal(8.4)
The devloc contains the name of a sensor location (ie. freezer1, storage2, smoker3), value contains the sensor reading, and timest contains the date/time the reading was made.
Most of the readings are synchronized, so that at a given point in time, all sensors are polled and the value stored. This yields a database that looks something like this:
+---------------------+--------------------+---------+
| timest | devloc | value |
+---------------------+--------------------+---------+
| 2016-10-15 00:00:44 | freezer1 | 16.1000 |
| 2016-10-15 00:00:44 | freezer2 | 17.5500 |
| 2016-10-15 00:00:44 | storage2 | 69.6875 |
| 2016-10-15 00:00:44 | smoker3 | 99.2375 |
| 2016-10-15 00:00:44 | storage1 | 81.9500 |
+---------------------+--------------------+---------+
I would like to have a query that would put results horozontally across the screen for each devloc per timest. Something like this:
timest freezer1 freezer2 storage1 storage2 smoker3
2016-10-15 00:00:44 16.1000 17.5500 81.9500 69.6875 99.2375
2016-10-15 03:01:44 16.0032 17.0001 81.9000 69.5525 121.0565
I know very basic SQL and creating that kind of query is way over my head. I tried searching google for help, but I dont even know what I'm asking for!
So, if anyone can help, it would be appreciated.
Thanks to you all in advance.
-Michael
Subject
Written By
Posted
consolidated result columns
October 17, 2016 05:51PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.