select A.ID,A.V_Name,A.V_FileType, 0 as i_masterid,A.I_Size,A.v_serPath,A.v_serpath+A.v_serfilename filepath
from P_FixFileList A
where A.ID NOT IN (SELECT I_FixFileListID FROM P_DocFixFileList WHERE I_MASTERID =a )
Union
select ID,V_Name,V_FileType,i_masterid,I_Size,v_serPath,v_serpath+v_serfilename filepath
from P_DocFixFileList
WHERE I_MASTERID = a
a为相同的数