I'm working on a query that uses COALESCE for retrieving localized strings for my current project
The sql works when used as a raw query but i cant seem to get the joins structured in this way with the query builder
LEFT JOIN text as text_se
ON (main_table.text = text_se.id)
AND (text_se.lang_code = 'SV')
This code:
->join(array('text', 'text_se', 'LEFT')
->on('main_table.text', '=', 'text_se.id')
->on('text_se.lang_code', '=', 'SV')
Only results in
LEFT JOIN text as text_se
ON (main_table.text = text_se.id AND text_se.lang_code = 'SV')
Which doesn't do the same... Have anyone else used AND after the JOIN-statement and can help me with it?