Code:
SELECT eds_ac.id ,eds_ac_cstm.alloc_fam_c,eds_ac_cstm.alloc_logement_c,eds_ac_cstm.amal1_c,eds_ac_cstm.amal2_c,eds_ac_cstm.amal3_c,eds_ac_cstm.amal4_c,eds_ac_cstm.amal5_c,eds_ac_cstm.amal6_c,eds_ac_cstm.amal7_c,eds_ac_cstm.amal8_c,eds_ac_cstm.amaltot_c,eds_ac_cstm.amal_c,eds_ac_cstm.charges_c,eds_ac_cstm.charges_div_c,eds_ac_cstm.charges_div_just_c,eds_ac_cstm.cmpl_frais_div_c,eds_ac_cstm.datedemande_c,eds_ac_cstm.datereponse_c,eds_ac_cstm.diff_reven_ress_c,eds_ac_cstm.fortune_brute_c,eds_ac_cstm.impot_source_c,eds_ac_cstm.limite_revenu_c,eds_ac_cstm.loyer_c,eds_ac_cstm.loyer_pris_en_compte_c,eds_ac_cstm.montantac_c,eds_ac_cstm.nbpersonne_c,eds_ac_cstm.pension_recue_c,eds_ac_cstm.pension_versee_c,eds_ac_cstm.rentes_c,eds_ac_cstm.ressources_div_c,eds_ac_cstm.ress_div_just_c,eds_ac_cstm.revenu_fortune_c,eds_ac_cstm.reven_determinant_c,eds_ac_cstm.salaire_conj_c,eds_ac_cstm.salaire_de_c,eds_ac_cstm.salaire_net_c,eds_ac_cstm.statutdemande_c,eds_ac_cstm.subside1_c,eds_ac_cstm.subside2_c,eds_ac_cstm.subside3_c,eds_ac_cstm.subside4_c,eds_ac_cstm.subside5_c,eds_ac_cstm.subside6_c,eds_ac_cstm.subside7_c,eds_ac_cstm.subside8_c,eds_ac_cstm.subside_tot_c,eds_ac_cstm.total_depen_c,eds_ac_cstm.total_ressource_c, eds_ac.name , CONCAT(IFNULL(jt0.first_name,''),' ',IFNULL(jt0.last_name,'')) contacts_eds_ac_name, jtl0.contacts_edaccontacts_ida contacts_edaccontacts_ida, eds_ac.assigned_user_id FROM eds_ac LEFT JOIN eds_ac_cstm ON eds_ac.id = eds_ac_cstm.id_c LEFT JOIN contacts_eds_ac_c jtl0 ON eds_ac.id=jtl0.contacts_eds_aceds_ac_idb AND jtl0.deleted=0
LEFT JOIN contacts jt0 ON jt0.id=jtl0.contacts_edaccontacts_ida AND jt0.deleted=0
AND jt0.deleted=0 where ((jt0.name like 'M. Dupont Pierre%')) AND eds_ac.deleted=0 LIMIT 0,21
You can see that at the end of the query, sugar look for : name like "Dupont Pierre" in the contacts table. But there is no name field. It should look into the fields first_name and last_name.
Bookmarks