Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Statement

Status
Not open for further replies.

Krubnik

MIS
Sep 5, 2001
1
IR
Hi dear expert,
I've got a critical problem. Suppose we have 2 tables like following:

Flight Table:
1-FirstName
2-LastName
3-ArrivalCode
4-DepartureCode

Airlines Table:
1-AirlineCode
2-Airline

The AirlineCode goes into ArrivalCode and DepartureCode.
I want to get a query that defines Arrival Airline and
Departure Airline like this:
1-FirstName
2-LastName
3-ArrivalAirline
4-DepartureAirline

Whould you please tell that what should I do?
thanx so much,
 
SELECT tblFlight.FirstName, tblFlight.LastName, tblAirline.Airline, tblAirline_1.Airline
FROM (tblFlight INNER JOIN tblAirline AS tblAirline_1 ON tblFlight.ArrivalCode = tblAirline_1.AirlineID) INNER JOIN tblAirline ON tblFlight.DepartureCode = tblAirline.Airline;
Tyrone Lumley
augerinn@gte.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top