Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
s2002
Starting Member
49 Posts |
Posted - 2010-08-22 : 14:18:59
|
| HelloDB Table "name: PType" structure ID Name Total CatID1 My 10 12 Nu 20 23 My 11 1I want to List PType records group by Name, order by Sum(Total)I use belowselect Name,sum(Total) as Total from PType group by Nameorder by SUM(Total) descNow I want to Convert above SQL query to linq But I Got Error . Is there any other way to have the same result and better linq query?This is the Linq Query I UseFrom PType In db.PType _Group PType By PType .Name Into g = Group _Order By _ g.Sum(Function(p) p.Total) Descending _Select _ Name, _ Hits = CType(g.Sum(Function(p) p.Total),Int32?) |
|
|
|
|
|