---SQL for Dummy data in the image
select person_id,dt,version_nbr,dept,pd
from
(
select 2345 person_id,trunc(sysdate)-30 dt,0 version_nbr,'HR' dept, 'PD1' PD from dual
union all
select 2345 person_id,trunc(sysdate)-6,1,'Finance', 'PD2' from dual
union all
select 2345 person_id,trunc(sysdate)-3,2,'Finance', 'PD3' from dual
union all
select 2345 person_id,trunc(last_day(sysdate) ),3,'Sales', 'PD3' from dual
union all
select 1264 person_id,trunc(sysdate)-30 ,0 ,'Global HR' dept, 'PD1' PD from dual
union all
select 1264 person_id,trunc(sysdate)-6,1,'Global Finance', 'PD2' from dual
union all
select 1264 person_id,trunc(sysdate)-3,2,'Global Finance', 'PD3' from dual
union all
select 1264 person_id,trunc(last_day(sysdate) ),3,'Global Sales', 'PD3' from dual
) a
order by 1,2
|