exists用在linq上
2024-09-06 00:14:03
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支持这种写法。
最新文章
- ubuntu下网络IP设置相关命令
- 无法卸载jdk的解决方法
- ubuntu 14.04 LTS 安装ss客户端
- hdu 2899 Strange fuction
- 为DEDE织梦添加XMl网站地图
- Spark 大数据平台
- 后台调用外部程序的完美实现(使用CreateDesktop建立隐藏桌面)
- Linux 教程 技巧集
- TensorFlow与OpenCV,读取图片,进行简单操作并显示
- 截取字段split
- MongoDB初探-基本语句和数据结构
- ubuntu 部署 wiki.js
- Shell基础知识(三)
- winscp 怎么用私钥文件登录的,以.ppk结尾的密钥文件
- SharePoint 2013 地址栏_layouts/15/start.aspx#
- ehcache 页面整体缓存和局部缓存
- 解决shell命令";** is not in the sudoers file...";错误
- MySQL学习笔记:repeat、loop循环
- springDataJpa学习笔记
- juery获取元素的方法