Welling Posted November 7, 2008 Share Posted November 7, 2008 I'm trying to do a sql outer join: SELECT ft.id, ft.ult_resp, fl.fecha FROM forotemas ft LEFT OUTER JOIN foroleidos fl ON fl.id_tema = ft.id WHERE fl.id_usu = "2" But sometimes there are a value in foroleidos for each of forotemas and don't works like "outer join" including all results of forotemas although the fl.fecha value were null like this must do, What happens? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/131831-solved-outer-join/ Share on other sites More sharing options...
corbin Posted November 7, 2008 Share Posted November 7, 2008 I'm sorry, but... what? Do you mean it pulls empty rows sometimes? If that's your problem, just use a JOIN. Quote Link to comment https://forums.phpfreaks.com/topic/131831-solved-outer-join/#findComment-684918 Share on other sites More sharing options...
Barand Posted November 8, 2008 Share Posted November 8, 2008 needs a small tweak SELECT ft.id, ft.ult_resp, fl.fecha FROM forotemas ft LEFT OUTER JOIN foroleidos fl ON fl.id_tema = ft.id AND fl.id_usu = "2" WHERE conditions on a right table need to be part of the JOIN conditions Quote Link to comment https://forums.phpfreaks.com/topic/131831-solved-outer-join/#findComment-684950 Share on other sites More sharing options...
Welling Posted November 8, 2008 Author Share Posted November 8, 2008 needs a small tweak SELECT ft.id, ft.ult_resp, fl.fecha FROM forotemas ft LEFT OUTER JOIN foroleidos fl ON fl.id_tema = ft.id AND fl.id_usu = "2" WHERE conditions on a right table need to be part of the JOIN conditions Thank you, it works Quote Link to comment https://forums.phpfreaks.com/topic/131831-solved-outer-join/#findComment-685295 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.