MySQL Forums
Forum List  »  Newbie

Re: Query Help
Posted by: Peter Brawley
Date: August 03, 2016 08:16AM

Is this what you mean?

select 
  class,  
  week(insert_time) as wk, 
  count(*) as count, 
  sum( if(host is null or host='',1,0) ) as 'Invalid hosts'
from alarms
where insert_time > '2016-07-01 00:00:00' 
group by class,wk ;

Options: ReplyQuote


Subject
Written By
Posted
August 01, 2016 05:42PM
Re: Query Help
August 03, 2016 08:16AM


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.