SELECT CLAVE, MAX(PRECIO) FROM TABLA A WHERE NOT EXISTS(SELECT 1 FROM TABLA WHERE CLAVE = A.CLAVE GROUP BY CLAVE HAVING MAX(PRECIO) <> A.PRECIO) GROUP BY CLAVE