My code
Code: Select all
select d.direction_code
, f.Direction_Id
, substr(char(MAX(vdate_Month_Id)),5,2)
, SUBSTR(CHAR(MAX(vdate_Month_Id)),1,4)
, max(vdate_Month_Id)-100
, max(f.update_date)
from db2admin.DW_JOC_ALL_DATA_TBL f, db2admin.REF_DIRECTION_LU_TBL d
where f.direction_id = d.direction_id
group by d.direction_code
, f.Direction_Id
Jim