CREATE FUNCTION dbo.fun_orgname(@id int)
RETURNS varchar(8000)
AS
BEGIN
DECLARE @str varchar(8000)
SET @str = ‘‘
select @str = @str + ‘,‘ +r.NAME from PRINCIPAL_ORG t left join ORG r on t.ORG_ID=r.ID where [email protected]
RETURN STUFF(@str, 1, 1, ‘‘)
END
GO
时间: 2024-10-08 12:45:19