如何在 LINQ 查詢中使用 GROUP BY 獲取 MAX 行? - How do I get the MAX row with a GROUP BY in LINQ query?

問題:

I am looking for a way in LINQ to match the follow SQL Query.我正在 LINQ 中尋找一種方法來匹配以下 SQL 查詢。

Select max(uid) as uid, Serial_Number from Table Group BY Serial_Number

Really looking for some help on this one.真的在尋找一些幫助。 The above query gets the max uid of each Serial Number because of the Group By Syntax.由於Group By Syntax,上述查詢獲取每個序列號的最大 uid。


解決方案:

參考: https://stackoom.com/en/question/f2w
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章