Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
select COUNT(*) count_departured, SUM(case when actual_departure-scheduled_departure>'00:30:00' then 1 else 0 end) count_delayed, round(SUM(case when actual_departure-scheduled_departure>'00:30:00' then 1 else 0 end)*100.00/COUNT(*), 2) delayed_flights_rate from flights where departure_airport='DME' and to_char(scheduled_departure, 'YYYY-MM')='2017-08' and status='Arrived'

Stuck with a problem? Got Error? Ask AI support!

Copy Clear