var list = from item in
(from s in _sysBll.GetList(s => s.ParamID == "TraSchType" && s.ParamCode != null)
join t in data on s.ParamCode equals t.TraSchType into tmp
from f in tmp.DefaultIfEmpty()
select new
{
value = tmp.Count(),
name = s.ParamDescn,
ParamCode = s.ParamCode
})
group item by item.ParamCode into query
select new
{
value = query.Max(m => m.value),
name = query.Max(m => m.name)
};

linq之左连接 + group by的更多相关文章

  1. Linq实现左连接、右连接

    --一本错误的记录 insert into Book values('错误时怎样练成的',111)   --左连接 select s.name,b.name from student as s lef ...

  2. Lambda方式左连接有Linq方式左连接

    网上查到的直接使用Join+DefaultIfEmpty的方式是错误的,实际生成SQL是两表先内联接,然后再LEFT JOIN.经过查证,参考资料,最终得到如下两种方式的左连接写法: public v ...

  3. LINQ的左连接、右连接、内连接

    .左连接: var LeftJoin = from emp in ListOfEmployees join dept in ListOfDepartment on emp.DeptID equals ...

  4. linq实现左连接

    1.左连接: var LeftJoin = from emp in ListOfEmployees join dept in ListOfDepartment on emp.DeptID equals ...

  5. linq 之左连接

    List<ArticleModel> articleList = articleRepository.GetAllArticle(); List<UsersModel> use ...

  6. LINQ的左连接、右连接、内连接和Lamda表达式实现Left join

    1.左连接: var LeftJoin = from t1 in l1join t2 in l2on t1.ID equals t2.ID into Joinedt12from t3 in Joine ...

  7. linq的左连接右连接内连接用法

    1.左连接: var LeftJoin = from e in ListOfEmployees join d in ListOfDepartment on e.DeptID equals d.ID i ...

  8. linq join 左连接 leftjoin 多个on条件 where 条件

    var haveChange = from newScore in newScoreList join oldScore in oldScoreList on new{newScore.ExamId, ...

  9. Linq Left Join;linq左连接 (转载)

    来源 https://www.cnblogs.com/xinjian/archive/2010/11/17/1879959.html 准备一些测试数据,如下: use Test Create tabl ...

随机推荐

  1. WPF在Canvas中绘图实现折线统计图

    最近在WPF中做一个需要实现统计的功能,其中需要用到统计图,之前也没有接触过,度娘上大多都是各种收费或者免费的第三方控件,不想用第三方控件那就自己画一个吧. 在园子还找到一篇文章,思路来自这篇文章,文 ...

  2. 使用 IIS 在 Windows 上托管 ASP.NET Core2.0

    准备: 操作系统:Windows Server 2008 R2 或更高版本 开发环境:VS2017 第一步:新建项目ASP.NET Core Web应用程序 在 Visual Studio 中,选择“ ...

  3. CSS3下的渐变文字效果实现

    如下,第一种方法已实践 一.方法一:借助mask-image属性 可以狠狠地点击这里:CSS3下的渐变文字效果方法一demo 如果您手头上的浏览器是Chrome或是Safari,则您可以在demo页面 ...

  4. 二十:让行内元素在div中垂直居中

    (1)使用display:table-cell配合vertical-align:center(淘宝也是这样用的) <div class="method4"> <s ...

  5. Leetcode 26. Remove Duplicates from Sorted Array (easy)

    Given a sorted array, remove the duplicates in-place such that each element appear only once and ret ...

  6. hibernate设置二级缓存时报错java.lang.NoClassDefFoundError: org/hibernate/engine/jndi/JndiNameException

    错误提示大概意思是,没有类定义错误,就是找不到要使用的hibernate二级缓存管理引擎类.我在这用的是ehcache二级轻量级缓存,报错原因可能是导入的jar包版本和使用的hibernate框架核心 ...

  7. p201 谱集是闭集 有界集

    1 是如何来的?  由1 如何推出 2 2 是如何来的?谢谢 1.σ是的补集 入属于ρ  稠密是因为   T有定义的地方,λI-T都有定义,有界是因为 所以 然后 ρ是σ的补集 模比||T||大的数都 ...

  8. windows中在vs code终端使用bash

    vs code Visual Studio Code的缩写,很好用的一个编辑器. 终端 vs code的终端(命令行)在windows中,默认使用的是powershell,如下图所示: powersh ...

  9. 【学习总结】Git学习-参考廖雪峰老师教程-期末总结

    学习总结之Git学习-总 目录: 一.Git简介 二.安装Git 三.创建版本库 四.时光机穿梭 五.远程仓库 六.分支管理 七.标签管理 八.使用GitHub 九.使用码云 十.自定义Git 期末总 ...

  10. chrome extensions notifications

    developer.chrome.comhttps://developer.chrome.com/extensions/notifications notification | MDNhttps:// ...