SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
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 ChatGPT!

Copy Clear