我有这个快速查询,但由于我的表名为 User(SQL 关键字),Linqer(SQL 到 LINQ 转换器)无法转换 SQL 查询。
这是查询:
SELECT TOP (100) PERCENT
dbo.[User].OID,
dbo.[User].FirstName + ' ' + dbo.[User].LastName AS [User Name],
COUNT(dbo.AssignedCounty.OID) AS [Counties Assigned],
dbo.UserType.Name AS [User Type]
FROM
dbo.UserType
INNER JOIN dbo.[User] ON dbo.UserType.OID = dbo.[User].UserTypeID
LEFT OUTER JOIN dbo.AssignedCounty ON dbo.[User].OID = dbo.AssignedCounty.UserID
GROUP BY
dbo.[User].OID,
dbo.[User].FirstName + ' ' + dbo.[User].LastName,
dbo.UserType.Name,
dbo.[USER].IsActive
HAVING
(dbo.[User].IsActive = 1)
ORDER BY
[User Name]
谁能指导我如何解决这个问题?我需要 LINQ。