text: --
  -- The following queries can be used to view inspect the result 
  -- tables generated by te queries in analyze.sql
  -- This can be useful if you want to sort by different columns, etc.
  --
  
  
  -- by device
  select * from by_device order by  up_percentage asc;
  
  -- by type
  select * from by_type order by up_percentage asc;
  
  --by type and manufacturer
  select * from by_type_and_manufacturer order by up_percentage asc;
  
  -- by month
  select * from by_month order by type,year,month;
  
  -- uptime by month for specific device
  select * from by_device_and_month where object='ITS35 AG 17.10' order by type, object,year,month asc;
  
  -- lowest uptime by months across all devices
  select * from by_device_and_month order by up_percentage asc;
  
  -- most disconnects by device, for each month
  select * from by_device_and_month order by year desc, month desc, disconnects desc;
  
  -- lowest uptime by devices for specific month
  select * from by_device_and_month where year=2019 and month=1 order by up_percentage asc;
  
  -- lowest uptime by devices for specific month and specific type of device
  select * from by_device_and_month where type='RSMP traffic light' and year=2019 and month=1 order by up_percentage asc;
  
  -- currenty offline, sorted by duration
  select *, NOW()-at as duration from by_last_seen order by at asc;
  
  -- currenty offline TCLs, sorted by duration
  select *, NOW()-at as duration from by_last_seen where type='RSMP traffic light' order by at asc;
  