Something like this (name columns as desired):

  select status, count(*) from events -
  where scheduled_start>current_timestamp-24 hours and -
    ( status='Failed' or status='Missed' ) -
  group by status


On 3/26/20 10:51 AM, Loon, Eric van (ITOP NS) - KLM wrote:
> Hi guys,
>
> I have two SQL queries:
>
> select count(*) as "Number_Of_Failed" from events where 
> scheduled_start>current_timestamp-24 hours and status='Failed'
> select count(*) as "Number_Of_Missed" from events where 
> scheduled_start>current_timestamp-24 hours and status='Missed'
>
> Is it somehow possible to combine them into one single query? I know I can 
> use and status='Failed' or status='Missed', but I would like to be able to 
> see how many are missed and how many are failed separately. My aim is to see 
> if I can use one single line (with multiple columns) to report this in SPOC.
> Thanks for any help in advance!
>
> Kind regards,
> Eric van Loon
> Air France/KLM Storage & Backup


--
Hello World.                                David Bronder - Systems Architect
Segmentation Fault                                      ITS-EI, Univ. of Iowa
Core dumped, disk trashed, quota filled, soda warm.   david-bron...@uiowa.edu

Reply via email to