以下是使用SqlUserDefinedAggregate
:http://msdn.microsoft.com/en-us/library/91e6taax(v=vs.80).aspx
允许您这样做:
SELECT LastName, COUNT(LastName) AS CountOfLastName, dbo.CountVowels(LastName) AS CountOfVowels
FROM Person.Contact
GROUP BY LastName
ORDER BY LastName
我怎样才能将其转换为dbo.CountLetters(LastName, 'listOfLetters')
?换句话说,在聚合值时如何获取额外的参数?使用常规CLR功能很容易,但是如何在这里做到这一点让我感到厌烦。谢谢!