SELECT * FROM (
SELECT ROW_NUMBER() OVER(PARTITION BY x ORDER BY y DESC) rn,t.*
FROM test1 t
) WHERE rn = 1;