Everytime I think I've got joins figured out, they turn out not to work the way I thought. This time they've really got me confused.
I have the following tables, with the relevant fields:
To_ver: tripkey
Clients: clientkey, clname
Trips: clientkey, tripkey, ipickup, idropoff
Locations: lockey, cloc
I want all the records from to_ver (which is a list of trips that were taken). All the records in to_ver have trips associated with them. From these trips, I want to connect to the clients table to get "clname", and connect to the locations table to get the "cloc" associated with ipickup and idropoff. (ipickup and idropoff contain the equivilent of lockey in the locations table)
I need to end up with all the info from to_ver, matched with the client that took the trip, and the pickup and dropoff location.
So how do I do that in SQL?
Thanks,
-Michelle
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement