SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
SELECT TRIM(TO_CHAR(flights.scheduled_arrival, 'Day')) AS day_of_week, COUNT(DISTINCT flights.flight_id) AS flights, COUNT(boarding_passes.ticket_no) AS passengers FROM flights LEFT JOIN boarding_passes ON flights.flight_id = boarding_passes.flight_id WHERE flights.departure_airport = 'DME' AND flights.arrival_airport = 'LED' GROUP BY TRIM(TO_CHAR(flights.scheduled_arrival, 'Day')), EXTRACT(DOW FROM flights.scheduled_arrival) ORDER BY (CAST(EXTRACT(DOW FROM flights.scheduled_arrival) AS INTEGER) + 6) % 7;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear