create table t (
user_id int, value_1 int, value_2 int
);
insert into t
values
(100, 50, 1),
(100, 50, 2),
(101, 50, 1),
(101, 50, 2),
(102, 50, 2),
(102, 50, 3);
select
*
from
t;
with t1 as(
SELECT user_id, value_1, ROW_NUMBER () OVER (partition by user_id ORDER BY value_2) AS row_num
FROM t
)
delete from t using t1 where t1.user_id = t.user_id and t.value_1 = t.value_1 and row_num>1;
select
*
from
t;