Comments (4)
var orderUserIdQuery = this.DbContext.Query《Order》().Select(c => c.OrderUserId);
q.Where(a => !orderUserIdQuery.ToList().Contains(a.UserId) ).ToList();
注意,orderUserIdQuery.ToList() 要写在 Where 方法的 lambda 里
ps:Chloe没有AsQueryable方法
from chloe.
var qq = this.DbContext.Query().Select(c => c.Id);
q.Where(a => !qq.ToList().Contains(a.CityId) ).ToList();
from chloe.
System.NotSupportedException
HResult=0x80131515
Message=Does not support method 'Queryable.Contains(IQueryable`1 source,Int64 item)'.
Source=Chloe.MySql
查询没有购买订单的用户, 这个动作怎么能直接在数据库完成, 而不是我先通过程序查出来该买订单的用户id集合
from chloe.
System.NotSupportedException HResult=0x80131515 Message=Does not support method 'Queryable.Contains(IQueryable`1 source,Int64 item)'. Source=Chloe.MySql
查询没有购买订单的用户, 这个动作怎么能直接在数据库完成, 而不是我先通过程序查出来该买订单的用户id集合
改成右边的就可以, 但是这样把用户id都查询到内存里了, 我想着两个查询在一个sql里完成
from chloe.
Related Issues (20)
- 分表批量添加数据报Chloe.Sharding.ShardingDbSessionProvider.IsInTransaction.get()错误 HOT 3
- GroupBy后如何排序? HOT 3
- 大数据量删除,针对如下代码操作,有优化建议吗? HOT 1
- 使用过程出现了ExecuteReader 要求已打开且可用的 Connection。连接的当前状态为打开。 HOT 2
- 有没有一个方法 可以看到执行的sql 语句 HOT 3
- An item with the same key has already been added. Key: server=...... HOT 3
- 想实现随机查询结果 HOT 1
- 如何查询字段长度大于5的数据 HOT 2
- 为啥我引用了Chloe还是会报错 HOT 1
- 查询数据抛出异常 HOT 3
- 子查询ToList() HOT 12
- a.Id HOT 2
- 偶发性崩溃 HOT 8
- BUG 原生SQL查询,返回对象映射没有忽略掉[NotMapped]的属性 HOT 10
- Could not load file or assembly 'Microsoft.Data.SqlClient HOT 1
- 是否支持查看执行的sql语句 HOT 3
- mysql 查询报错 HOT 2
- 多表联合查询,能左边表select all吗 类似 sugarsql那样 HOT 7
- 临时切换ConnectionString HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chloe.