Ver originalSELECT a.* FROM articulos a INNER JOIN (SELECT DISTINCT ac_id FROM categorias ORDER BY rand() LIMIT 1) a1 ON a.acat=a1.ac_id;