SELECT [ID] ,[APP_NAME] ,[TYPE] ,[DESCRIBE] ,[UPDATE_FILE] ,[UPDATE_TIME] ,se.[U_ID] ,se.[CREATE_TIME] ,su.REALNAME as UNAME ,DIC.TYPENAME AS PTNAME ,replace(replace( stuff( ( (SELECT ' #a target="_blank" href="/' + FILEPATH +'"$'+FILETILE + '#/a$' FROM SYS_ATTACHMENT WHERE ','+UPDATE_FILE+',' like '%,'+CAST(AID AS VARCHAR(50))+',%' FOR XML PATH(''))),1,1 ,''),'#','<'),'$','>') href FROM [dbo].[EMPS_SYSTEM_UPDATE] as se left join SYS_USER as su on su.U_ID = se.U_ID LEFT JOIN SYS_PUBLICTYPEINFO AS DIC ON DIC.TYPEVALUE = se.APP_NAME AND SIGN = 2010
标签:SYS,UPDATE,su,id,逗号,拼接,DIC,ID,se From: https://www.cnblogs.com/privateLogs/p/18215105