外键为','(逗号)拼接ID,连接查询外键表ID
select distinct pipeId=substring(a.PipeIn,b.number,charindex(',',a.PipeIn+',',b.number)-b.number) from B_PipeSet_Info a join master..spt_values b on b.type='P' where charindex(',',','+a.PipeIn,b.number)=b.number
!!!转发请注明出处和作者名称。
!!!转发请注明出处和作者名称。
!!!转发请注明出处和作者名称。
重要的事,说三遍。