masteroleary Posted February 7, 2007 Share Posted February 7, 2007 SELECT site.name AS name FROM site LEFT JOIN shoot_site ON site.id = shoot_site.site_id LEFT JOIN model_shoot ON shoot_site.shoot_id = model_shoot.shoot_id WHERE model_shoot.model_id = 6 Im only recieving one 'name' value when I should be getting two. My tables are like this: table.Column1 => table.Column2 model_shoot.model_id = 6 => model_shoot.shoot_id = 1;2 shoot_site.shoot_id = 1 => shoot_site.site_id = 1 shoot_site.shoot_id = 2 => shoot_site.site_id = 2 site.id = 1 => site.name = 'Site 1' site.id = 2 => site.name = 'Site 2' Quote Link to comment Share on other sites More sharing options...
btherl Posted February 7, 2007 Share Posted February 7, 2007 By 1;2 do you mean that there are two rows, one with value 1 and one with value 2? A good approach to debugging this would be to remove one of the joins and see what happens. Then try removing the other join as well. Another option is to turn the left join into an inner join (which is probably what you want anyway), and also try an outer join to see what changes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.