我得到了这个查询,但它真的很慢。我是 SQL 新手,因此我们将不胜感激任何有关 Tuning 的帮助。
SELECT
REPLACE(LoweredUserName,'@domain.com','') as Name,
COUNT(LoweredUserName) as Numb
FROM
aspnet_Users
JOIN
WarrantyRegistration ON CHARINDEX('Added by ' + aspnet_Users.LoweredUserName,
WarrantyRegistration.Comment) > 0
GROUP BY
aspnet_Users.LoweredUserName
ORDER BY
LoweredUserName ASC
谢谢