region SELECT * FROM `wp_posts` p LEFT JOIN wp_postmeta pm_deps ON p.ID = pm_deps.post_id LEFT JOIN wp_postmeta pm_ville ON p.ID = pm_ville.post_id LEFT JOIN wp_postmeta pm_code_postal ON p.ID = pm_code_postal.post_id WHERE p.post_type = 'annonce' AND p.post_status = 'publish' AND pm_deps.meta_key = 'departement' AND (1=0 OR pm_deps.meta_value = %s OR pm_deps.meta_value = %s ) AND pm_ville.meta_key = 'ville' AND pm_code_postal.meta_key = 'code_postal' AND (pm_ville.meta_value LIKE %s OR pm_code_postal.meta_value LIKE %s) GROUP BY p.ID ORDER BY p.post_date DESC