create temporary table temp_n_id ENGINE=MyISAM ( SELECT notice_id FROM notices JOIN exemplaires ON expl_section='4' and expl_location='1' and expl_notice=notice_id ,notice_statut WHERE 1 and statut=id_notice_statut and ((notice_visible_opac=1 and notice_visible_opac_abon=0)) GROUP BY notice_id)