vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| hi all. im having a problem and wondering if anyone an help. i have the following tables along with column names (too many columns so im just including the relevent ones): folders --------- name id categoryid photos ---------- name folderid id categories ------------ name id im trying to get a resultset back of every folder along with its category name and 1 example photoid from each. so far i have this select f.*, c.name as category, p.id as photoid, p.name as photoname from folders f, categories c, photos p where c.id = f.categoryid and f.id = p.folderid this doesnt work as most folders will have many photos in it so i get multiple rows back for the same folder id. is there a way i can do this so i only get 1 row per folder? if it matters im running v8.1. thanks |