Ver originalSELECT t1.REF,t1.elem FROM F_datos AS t1LEFT JOIN(SELECT REF FROM F_DATOS GROUP BY REF HAVING COUNT(*) < 2) AS t2 ON (t1.REF=t2.REF)