Вы можете использовать first_value()
:
select firstvalue as columnA, id as columnB
from (select *, first_value(id) over (partition by us order by date) as firstvalue
from table
) t
where id <> firstvalue;
Если вы хотите вставить набор результатов предыдущего запроса, используйте команду INSERT . . INTO
insert into table (columnA, columnB)
select firstvalue as columnA, id as columnB
from (select *, first_value(id) over (partition by us order by date) as firstvalue
from table
) t
where id <> firstvalue;