SELECT a.c_port_code, a.d_aststat, a.C_KM_NAME DWJZ
FROM t_r_fr_aststat a
where (A.C_PORT_CODE = 'SGU520')
and a.d_aststat = GETDAY_HDAY('CN',LAST_DAY(date'2023-07-01')+1,-1,'W')
and a.c_key_code = 'DWJZ'
and instr(a.c_km_code, '_') = 0