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 airport airport_code , AVG(cder) flights_count from (Select distinct airport , sum(cdep) cder from (Select distinct departure_airport as airport, count(*) cdep from flights where actual_departure is not null and actual_departure>'20170801' group by departure_airport union all Select distinct arrival_airport , count(*) cdep from flights where actual_arrival is not null and actual_arrival>'20170801' group by arrival_airport) l group by airport) k group by airport

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

Copy Clear