select distinct(nn.type_name),nn.id,nn.type_name,nn.ss from (
select p.id,p.type_name,count(e.police_type_id) over(partition by e.police_type_id) ss from POLICE_TYPE p
left join EVENT_TYPE e on p.id=e.police_type_id) nn;
select * from( select p.id,p.type_name,
count(e.police_type_id) OVER(partition by e.police_type_id) ss,
row_number() over(partition by p.id order by p.id) a from
POLICE_TYPE p,EVENT_TYPE e where p.id=e.police_type_id ) t where a = 1 ;
select nn.type_name,nn.id,nn.type_name,nn.ss,nn.aa from (
select p.id,p.type_name,count(e.police_type_id) over(partition by e.police_type_id) ss ,row_number()
over(partition by p.id order by e.id) aa from POLICE_TYPE p
left join EVENT_TYPE e on p.id=e.police_type_id) nn;