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_name->>'en' AS departure_airport, json_agg(DISTINCT arrival_airport ORDER BY arrival_airport) AS arrival_airports FROM airports_data ad JOIN flights f ON ad.airport_code = f.departure_airport GROUP BY airport_name->>'en' ORDER BY departure_airport

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

Copy Clear