How to do INNER JOIN on multiple columns in SQL?
I'm working on a homework project and I'm supposed to perform a database query that finds flights either by the city name or the airport code, but the
flights table only contains the airport codes so if I want to search by city I have to join on the
You can do INNER JOIN on multiple columns in SQL as shown below:
SELECT * FROM flights INNER JOIN airports ON ((airports.code = flights.fairport) AND (airports.code = flights.tairport))