SELECT distinct TEMP.vch_number,TEMP.vch_code,vch_name=stuff((select ‘;‘+vch_name from TABLEB where (vch_number=TEMP.vch_number and vch_name<>‘‘ ) for xml path(‘‘)),1,1,‘‘) FROM #TBL_READ_NUMBER TEMP
时间: 2024-10-12 22:25:56
SELECT distinct TEMP.vch_number,TEMP.vch_code,vch_name=stuff((select ‘;‘+vch_name from TABLEB where (vch_number=TEMP.vch_number and vch_name<>‘‘ ) for xml path(‘‘)),1,1,‘‘) FROM #TBL_READ_NUMBER TEMP