Advertisement
RickRock

Untitled

Aug 19th, 2020
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. SELECT
  2. COUNT(flights.flight_id) AS flights_amount,
  3. CASE
  4. WHEN aircrafts.model LIKE '%Boeing%' THEN 'Boeing'
  5. WHEN aircrafts.model LIKE '%Airbus%' THEN 'Airbus'
  6. ELSE 'other'
  7. END AS type_aircraft
  8. FROM
  9. aircrafts
  10. INNER JOIN flights ON aircrafts.aircraft_code = flights.aircraft_code
  11. WHERE
  12. CAST(flights.departure_time AS date) >= '2018-09-01' AND
  13. CAST(flights.departure_time AS date) < '2018-10-01'
  14. GROUP BY
  15. type_aircraft;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement