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 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. 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 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 Link to comment https://forums.phpfreaks.com/topic/131831-solved-outer-join/#findComment-685295 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.