select d.xh,nvl2(t.swjg_bm,'n','y') flag from dm_gy_ybxm d,t_zt_xmzt t where d.xh=t.xmzrm(+) and t.swjg_bm(+)='001584511'