joins Question Help Please
Posted: Thu Sep 02, 2004 6:42 pm
Hey Gang...
Yup Me again...
So I have a question about relations. I have mastered the art of querying and inserting within 1 table.. now I need to learn how to do it over 2 tables.
Lets say I have 2 tables
TABLE1 (cars)
id
car_name
car_type
TABLE 2 (parts)
id
part_name
car_relation
Now what I need to do if FIND ALL CARS THAT CONTAIN A CERTAIN PART AND THEN LIST THEM -
So I search for
part# 1001
My Search results would look like:
Honda Civic
Parts In This Car Include
1001
1002
1003
Toyota
Parts In The Car Include
1001
1004
1005
----
So it shows all cars that contain part # 1001 and also lists all other parts that that car contains as well... If that isn't possible though the query its not that big a deal it can list just the part that was searched for...
Can someone give me an example query for the situation above. I have come up empty and even more confused when reading about outter joins and natural joins..
Thanks a million
I owe this forum forever!
Yup Me again...
So I have a question about relations. I have mastered the art of querying and inserting within 1 table.. now I need to learn how to do it over 2 tables.
Lets say I have 2 tables
TABLE1 (cars)
id
car_name
car_type
TABLE 2 (parts)
id
part_name
car_relation
Now what I need to do if FIND ALL CARS THAT CONTAIN A CERTAIN PART AND THEN LIST THEM -
So I search for
part# 1001
My Search results would look like:
Honda Civic
Parts In This Car Include
1001
1002
1003
Toyota
Parts In The Car Include
1001
1004
1005
----
So it shows all cars that contain part # 1001 and also lists all other parts that that car contains as well... If that isn't possible though the query its not that big a deal it can list just the part that was searched for...
Can someone give me an example query for the situation above. I have come up empty and even more confused when reading about outter joins and natural joins..
Thanks a million
I owe this forum forever!