select occur,domain,keyid,content from ( select occur,domain,keyid,content, row_number() over(partition by domain,keyid) rn from table) where rn=1
Quote]{select occur,domain,keyid,content from ( select occur,domain,keyid,content, row_number() over(partition by domain,keyid) rn from table) where rn=1 }[/Quote]
select m.* from tb m where not exists (select 1 from tb n where domain = m.domain and keyid = m.keyid and occur > m.occur)
from (
select occur,domain,keyid,content,
row_number() over(partition by domain,keyid) rn
from table)
where rn=1
from (
select occur,domain,keyid,content,
row_number() over(partition by domain,keyid) rn
from table)
where rn=1
}[/Quote]
select m.* from tb m where not exists (select 1 from tb n where domain = m.domain and keyid = m.keyid and occur > m.occur)