I am trying search for flights departing from London and Arriving in Paris. The information about the cities are located in the Airport table, while the abbreviations for the departing and arriving airports are located in Flight.
Here's my code for the problem:
SELECT flightNo,flightCompany
FROM Flight
JOIN Airport
ON Airport.airportId=Flight.depAirport
WHERE Airport.city='London'
INTERSECT
SELECT flightNo,flightCompany
FROM Flight
JOIN Airport
ON Airport.airportId=Flight.arrAirport
WHERE Airport.city='Paris';
It returns 3 errors -
- SQL Status: HY000 Error code: 1000 Syntax error in SQL statement
- SQL Status: HY000 Error code: 1000
- SQL Status: HY000 Error code: 1000 syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE