SELECT stuff( (SELECT ',' +CAST(BigMidO2OCategroyId as varchar(10)) FROM TenantIndustryData WHERE TenantDataID = 10000 FOR xml path('')), 1, 1, '' )AS BigMidO2OCategroyIds