good. I have a query that already works in mysql but I have not been able to make it work in my codeigniter model, I have exactly syntax problems like this query could translate:
select t1.id_tabla1 as , t1.condicion,
greatest(coalesce(max(t1.Fecha), 0),coalesce(max(t2.Fecha), 0), coalesce(max(t3.Fecha), 0), coalesce(max(t4.Fecha), 0)) as 'max_fecha'
from tabla1 t1
left join tabla2 t2
on t2.id_tabla2 = t1.id_tabla1
left join tabla3 t3
on t3.id_tabla3 = t1.id_tabla1
left join tabla t4
on t4.id_tabla4 = t1.id_tabla1
group by t1.id_tabla1