【转】Linq使用Group By 3
摘要:
描述:根据顾客的国家分组,查询顾客数大于5的国家名和顾客数查询句法:var 一般分组 = from c in ctx.Customersgroup c by c.Country into gwhere g.Count() > 5orderby g.Count() descendingselect new{国家 = g.Key,顾客数 = g.Count()};对应SQL:SELECT [t1].[Country], [t1].[value3] AS [顾客数]FROM (SELECT COUNT(*) AS [value], COUNT(*) AS [value2], COUNT(*) 阅读全文
posted @ 2012-11-16 16:06 魔GUI 阅读(202) 评论(0) 推荐(0)
浙公网安备 33010602011771号