SELECT *,STUFF((SELECT ',' + struktur_bolmesi
FROM tb_Structure WHERE concat(',',bolmeler,',') LIKE concat('%,',struktur_id,',%')
FOR XML PATH('') ), 1, 1, '') as new_column from tb_Customers where new_column like '%text%'
答案 0 :(得分:0)
请尝试使用此
WITH Tbl AS(
SELECT *,STUFF((SELECT ',' + struktur_bolmesi
FROM tb_Structure WHERE concat(',',bolmeler,',') LIKE concat('%,',struktur_id,',%')
FOR XML PATH('') ), 1, 1, '')
as new_column from tb_Customers
)
SELECT *
FROM Tbl
WHERE new_column LIKE '%text%'