Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
superchuck
Starting Member
1 Post |
Posted - 2009-09-19 : 08:32:32
|
| The oversimplified version of my issue is this...Table Locations[LocationID][LocationName]Table Trips[TripID][TripDate][StartingLocation] <--LocationID[EndingLocation] <--LocationIDYou've probably figured it out already, but the question is, how do I do a query that returns all of the trips in the form:Trips.TripDate, Locations.LocationName, Locations.LocationNamewith the starting and ending locations represented. Thanks!Chuck |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-09-19 : 09:20:24
|
| SELECT T.TripDate, S.LocationName StartingLocation, E.LocationName EndingLocationFROM Trips TINNER JOIN Locations S ON T.StartingLocation=S.LocationIDINNER JOIN Locations E ON T.EndingLocation=E.LocationID |
 |
|
|
|
|
|