SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
explain analyze with t1 as ( select departure_airport , arrival_airport , date(actual_departure) ddate , date(actual_arrival) adate from flights where actual_departure >= '2017-07-31' and actual_departure < '2017-09-01' ) , t2 (airport_code) as ( select departure_airport from t1 where ddate between '2017-08-01' and '2017-08-31' -- union all -- select arrival_airport from t1 where adate between '2017-08-01' and '2017-08-31' ) select airport_code , ceil(count(*)/31.0) as flights_count from t2 group by airport_code having ceil(count(*)/31.0) <= 3 order by 2,1

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear