LINQ to SQL語句(6)之Group By/Having

Group By/Having操作符 適用場景:分組數據,爲我們查找數據縮小範圍。 說明:分配並返回對傳入參數進行分組操作後的可枚舉對象。分組;延遲 1.簡單形式: var q = from p in db.Products group p by p.CategoryID into g select g; 語句描述:使用Group By按CategoryID劃分產品。 說明
相關文章
相關標籤/搜索