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 , Round(AVG(cder/31),0) 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 having AVG(cder/31) <=3 order by AVG(cder/31), airport ; select * from query_cost('Select airport airport_code , Round(AVG(cder/31),0) 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 having AVG(cder/31) <=3 order by AVG(cder/31), airport ');

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

Copy Clear