Sorry in advance for such a lame question but I’m having trouble with creating a report that would show time ranges in each row in first column, for example 1st row - 0-1 hour, 2nd row - 1-2 hours, 3rd row - 2-3 hours and so on. The second column would present the number of devices that are within specific time range, for example:
|Time range||Devices count|
|0 - 1 h||100|
|1 - 2 h||68|
|2 - 3 h||10|
The main goal is to find out how many devices are operating within certain range of time. I know it may be hard not knowing the format of my database but maybe you would provide me at least some clue how to do this. I assume it may be achieved by using SQL native query but I couldn’t find anything on the net that would cover my needs (or did poor searching).
If it helps, my database is based on postgreSQL.