```sql
create table test.zzz_forest_info_51 as
select
    a.pnu,
    b.sid_nm,
    c.sgg_nm,
    d.emd_nm,
    e.ri_nm,
    substring(a.pnu,12, 4)::integer::varchar as bon,
    substring(a.pnu,16, 4)::integer::varchar as bu,
    trim(substring(a.jibun,0, length(a.jibun))) as jibun,
    right(a.jibun, 1) as jimok,
    a.area_hectare,
    a.jukjung,
    a.jukjung1,
    a.jaebe,
    a.jaebe1,
    a.na_imsang,
    a.na_yunggub,
    a.na_kyunggub,
    a.na_mildo,
    a.to_jiri,
    a.to_jihyung,
    a.to_moam,
    a.to_tosim,
    a.to_yugi,
    a.to_tosung,
    a.to_geunsup,
    a.to_geunmildo,
    a.avg_height,
    a.avg_slope,
    a.avg_aspect,
    a.label
from public.zzz_forest_info_51 a
left outer join comtn_map_admindistrict_sido b
on left(a.pnu,2) = b.sid_cd
left outer join comtn_map_admindistrict_sgg c
on left(a.pnu,5) = c.sgg_cd
left outer join comtn_map_admindistrict_emd d
on left(a.pnu,8) = d.emd_cd
left outer join comtn_map_admindistrict_ri e
on left(a.pnu,10) = e.ri_cd
```