select dbo.strconcat(r.Name) as Names, r.Category
from Reference r
group by r.Category
对于此查询,我需要获取至少有一个名称(r.Name)LIKE任何文本的类别。
示例:condition(LIKE'%123%')
123,2,4 - 更正名称
答案 0 :(得分:0)
这就是你要找的东西:
;WITH A
AS
(SELECT dbo.strconcat
(r.Name
) AS Names, r.Category
FROM Reference r
GROUP BY r.Category
)
SELECT *
FROM A
WHERE Names LIKE '%123%';