mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-05 07:50:52 +08:00
update
12
多表查询.md
12
多表查询.md
@@ -99,12 +99,12 @@ var list2 = select.Where(a => select.As("b").ToList(b => b.Id).Contains(a.Id)).T
|
||||
```csharp
|
||||
var subquery = select.ToSql(a => new {
|
||||
all = a,
|
||||
first = orm.Select<Child>().Where(b => b.ParentId == a.Id).First(b => b.Id),
|
||||
count = orm.Select<Child>().Where(b => b.ParentId == a.Id).Count(),
|
||||
sum = orm.Select<Child>().Where(b => b.ParentId == a.Id).Sum(b => b.Score),
|
||||
max = orm.Select<Child>().Where(b => b.ParentId == a.Id).Max(b => b.Score),
|
||||
min = orm.Select<Child>().Where(b => b.ParentId == a.Id).Min(b => b.Score),
|
||||
avg = orm.Select<Child>().Where(b => b.ParentId == a.Id).Avg(b => b.Score)
|
||||
first = fsql.Select<Child>().Where(b => b.ParentId == a.Id).First(b => b.Id),
|
||||
count = fsql.Select<Child>().Where(b => b.ParentId == a.Id).Count(),
|
||||
sum = fsql.Select<Child>().Where(b => b.ParentId == a.Id).Sum(b => b.Score),
|
||||
max = fsql.Select<Child>().Where(b => b.ParentId == a.Id).Max(b => b.Score),
|
||||
min = fsql.Select<Child>().Where(b => b.ParentId == a.Id).Min(b => b.Score),
|
||||
avg = fsql.Select<Child>().Where(b => b.ParentId == a.Id).Avg(b => b.Score)
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user