是否有可能使用一组例如(1,2,3,4,5)作为SQL Server 2008中的Sproc,函数或视图的参数?在SQL Server 2008中使用set作为参数来作用/ sproc?
我应该如何使用Sproc,函数或查看这个SLQ的pice?
WITH Scores AS(
SELECT
ItemId, SUM(Score) AS Score
FROM [Presenta].[presenta].[LpivScores]
WHERE
// HERE I want (1, 2, 3, 4, 5) to be the inparameter, like @inParam
ListPropertyItemId IN (1, 2, 3, 4, 5)
GROUP BY
ItemId
)
-- I want this to be returned
SELECT
i.Id,
s.Score
FROM
Scores s,
Items i
WHERE
s.ItemId = i.Id
任何帮助,非常感谢!