Hi folks!
example: select t1.name, t2.name2 from table1 t1 left join table2 t2 on t1.id = t2.f_id
the cool thing about a left join is that even if there is no equivalent in the joined table, you get a result, simply with the columns of the joined table empty.
however if there are more columns fitting in the joined table you'll get more results. this could be exactly NOT what I want
what I DO want, is that if there is a result in the joined table that matches a certain criteria (normally in the where clause) it should put it into the result (and only this one result), however if this criteria is not fullfilled, it should still display the rest of the result with the colums of the joined table empty. This does not work, because if there is no equivalent in the joined table and there is a condition on the joined table, which is not fullfilles, the result will be empty.
Do you understand what I want? If there is a solution to that, please post it!!!
Matthias
example: select t1.name, t2.name2 from table1 t1 left join table2 t2 on t1.id = t2.f_id
the cool thing about a left join is that even if there is no equivalent in the joined table, you get a result, simply with the columns of the joined table empty.
however if there are more columns fitting in the joined table you'll get more results. this could be exactly NOT what I want
what I DO want, is that if there is a result in the joined table that matches a certain criteria (normally in the where clause) it should put it into the result (and only this one result), however if this criteria is not fullfilled, it should still display the rest of the result with the colums of the joined table empty. This does not work, because if there is no equivalent in the joined table and there is a condition on the joined table, which is not fullfilles, the result will be empty.
Do you understand what I want? If there is a solution to that, please post it!!!
Matthias