摘要:
View Code 1 SET ANSI_NULLS ON 2 GO 3 4 SET QUOTED_IDENTIFIER ON 5 GO 6 7 CREATE FUNCTION [dbo].[Split] 8 ( 9 @c varchar(500) , 10 @split VARCHAR(500) 11 ) 12 RETURNS @t TABLE ( col VARCHAR(500) ) 13 AS 14 15 BEGIN 16 WHILE ( CHARINDEX(@split, @c) <> 0 ) 17 BEGIN 18 ... 阅读全文
摘要:
select n.*,columnname=stuff((select ','+m.fname from (select a.id,b.id as bid ,a.fname from s_projectdata a , (select operationtype,id from som_ent_enterprise) b where charindex(convert(varchar(10),a.id),b.operationtype) > 0 and parentid = '2') mwhere m.bid=n.id for xml path(' 阅读全文