CodeIgniter Forums
again about the third parameter in join query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: again about the third parameter in join query (/thread-8432.html)



again about the third parameter in join query - El Forum - 05-17-2008

[eluser]Unknown[/eluser]
thank you so much for the last time
but still a got some problems abaut the same topic
I´m working with the normal join query(active record) but the field that I use to join those tables could be NULL in the table one and of course in the other table there´s no record, and that´s the reason why I don´t have a result in my query.
I was wondering that maybe one of those third parameters could do that kind of work that I need,
Table one Table two valor2
id valor valor1 id_table_one adfadf
5 adfad adfad 5
NULL adasd asdfad

what I´m tring to say is that in the join active record give me back the record in valor and valor1 even when the value of id is NULL in table one, but when that value is not NULL just make the simple query.
sorry abaut my inglish that´s why I did the example ..
thanks


again about the third parameter in join query - El Forum - 05-17-2008

[eluser]Pascal Kriete[/eluser]
No need to double post Smile .

What you're looking for is a left outer join. I'm not great at doing them, but wikipedia has some great explanations.