SQL里面,有时候会用到exists或者not exists。

select * from yb t1 where not exists(select 1 from yb t2 where trunc(t1.yubaodate,'dd')=trunc(t2.yubaodate,'dd') and t1.yubaotype=t2.yubaotype and t1.id<t2.id)
order by id desc;

然后,LINQ里怎么用?

var t1 = ybRepository.GetAll();
var t2 = ybRepository.GetAll();
var list = from s in t1
where !t2.Any(ss => ss.YUBAODATE.Date == s.YUBAODATE.Date
&& ss.YuBaoType == s.YuBaoType
&& ss.ID > s.ID)
select s;

万幸,fluently nhibernate支持这种写法。

最新文章

  1. ubuntu下网络IP设置相关命令
  2. 无法卸载jdk的解决方法
  3. ubuntu 14.04 LTS 安装ss客户端
  4. hdu 2899 Strange fuction
  5. 为DEDE织梦添加XMl网站地图
  6. Spark 大数据平台
  7. 后台调用外部程序的完美实现(使用CreateDesktop建立隐藏桌面)
  8. Linux 教程 技巧集
  9. TensorFlow与OpenCV,读取图片,进行简单操作并显示
  10. 截取字段split
  11. MongoDB初探-基本语句和数据结构
  12. ubuntu 部署 wiki.js
  13. Shell基础知识(三)
  14. winscp 怎么用私钥文件登录的,以.ppk结尾的密钥文件
  15. SharePoint 2013 地址栏_layouts/15/start.aspx#
  16. ehcache 页面整体缓存和局部缓存
  17. 解决shell命令&quot;** is not in the sudoers file...&quot;错误
  18. MySQL学习笔记:repeat、loop循环
  19. springDataJpa学习笔记
  20. juery获取元素的方法

热门文章

  1. NYOJ 311 完全背包
  2. oracle客户端安装与配置
  3. POJ-1696 Space Ant 凸包版花式水过!
  4. Python之虚拟机操作:利用VIX二次开发,实现自己的pyvix(系列一)成果展示和python实例
  5. URAL Formula 1 ——插头DP
  6. oracle的split函数
  7. javaScriptCore 实战与小结
  8. PHP html_entity_decode() 函数
  9. 结构字段验证--validator.v9
  10. 关于css虚线