[Frubar Paste] Hosted by SkyLime - Chat with us at XChannel IRC

Posted by Anonymous on Thu 9th Aug 17:05
download

  1. SELECT * FROM (
  2.         SELECT h.data_center_id, h.type, count(*) AS count
  3.                 FROM host AS h INNER JOIN mshost AS m ON h.mgmt_server_id=m.msid
  4.                
  5.                 WHERE h.STATUS='Up' AND h.type='SecondaryStorage' AND m.last_update > ? GROUP BY h.data_center_id, h.type
  6.                
  7.         UNION ALL
  8.    
  9.         SELECT h.data_center_id, h.type, count(*) AS count FROM host AS h INNER JOIN mshost AS m ON h.mgmt_server_id=m.msid
  10.                 WHERE h.STATUS='Up' AND h.type='Routing' AND m.last_update > ? GROUP BY h.data_center_id, h.type
  11.  
  12. ) AS t ORDER BY t.data_center_id, t.type


Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.



Remember my name in a cookie


Code: To highlight particular lines, prefix each line with @@.
Include comments to indicate what you need feedback on.