Ver originalSELECT id FROM fotosWHERE referencia = xxAND nombre = 'sinfoto.gif'AND color IN (SELECT color, COUNT(*) AS dFROM fotosWHERE referencia = xxAND nombre = 'sinfoto.gif'GROUP BY colorHAVING d > 1)