imstillatwork
IS-IT--Management
Hello,
I have a query I can't figure out.
3 tables:
1)tblUsers
2)tblCars
3)tblPics
One USERS can have many CARS, on CAR can have many PICS.
I want to make a search.
As is right now, I select the USER and CAR info that is needed. The results are looped over, displaying each car.
During each loop, I run another query that looks up ONE PIC from the CAR that will be displayed.
so this means if there are 10 cars returned per page (there are at least that) the getPics Query runs 10 times to show the page. talk about inefficient.
HOW CAN I combine all three tables into one query so that..
all the USER information is selected, all the CAR information is selected, and ONE pic of each car is selected....if I do an left outer, then i get repeated results because I am displaying in CARS, and there can be many pics for each car. it is OK if this happens with USERS, I want the user repeated for every car that he has.
MAKE ANY SENSE?
thanks
Kevin
I have a query I can't figure out.
3 tables:
1)tblUsers
2)tblCars
3)tblPics
One USERS can have many CARS, on CAR can have many PICS.
I want to make a search.
As is right now, I select the USER and CAR info that is needed. The results are looped over, displaying each car.
During each loop, I run another query that looks up ONE PIC from the CAR that will be displayed.
so this means if there are 10 cars returned per page (there are at least that) the getPics Query runs 10 times to show the page. talk about inefficient.
HOW CAN I combine all three tables into one query so that..
all the USER information is selected, all the CAR information is selected, and ONE pic of each car is selected....if I do an left outer, then i get repeated results because I am displaying in CARS, and there can be many pics for each car. it is OK if this happens with USERS, I want the user repeated for every car that he has.
MAKE ANY SENSE?
thanks
Kevin