我正在尝试选择表中前五个最常见的值及其计数,并在字典中返回它们。我能够在SQL中获得这些值:
如何将代码转换为LINQ并将其赋值给字典(Dictionary)?
SELECT top 5
SR_Status,
COUNT(SR_Status) AS 'value_count'
FROM
ServiceRequests
GROUP BY
SR_Status
ORDER BY
'value_count' DESC;
如何将代码转换为LINQ并将其赋值给字典(Dictionary)?