BACK
with name_prf as (
select
a.*,
row_number() over (partition by emplid, name_type order by effdt desc) rn
from
ps_scc_names_qvw a)
emplid,
first_name
name_prf
where
rn = 1
and name_type = ‘PRF’
;