我的存储过程收到“@CategoryIDs varchar”
@CategoryIDs 包含一个或多个用“|”分隔的 ID,
我的存储过程如下所示:
Select R.ID,,CategoryID, (sum(C.Rating)/Count(R.ID)) as "Rating"
from Table1 R
left outer join Table2 C
ON R.ID = C.ID
GROUP BY R.ID
having R.CategoryID = @CatergoryID
RETURN