mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-20 23:30:57 +08:00
update
9
多表查询.md
9
多表查询.md
@@ -114,6 +114,15 @@ sql = select.From<TestTypeInfo, TestTypeParentInfo>((s, b, c) => s
|
|||||||
//WHERE (a.`Id` = 10 AND c.`Name` = 'xxx') AND (b.`ParentId` = 20)
|
//WHERE (a.`Id` = 10 AND c.`Name` = 'xxx') AND (b.`ParentId` = 20)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
或者
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
sql = fsql.Select<Topic, TestTypeInfo, TestTypeParentInfo>()
|
||||||
|
.Where((a, b, c) => a.Id == 10 && c.Name == "xxxx")
|
||||||
|
.Where((a, b, c) => b.ParentId == 20)
|
||||||
|
.ToSql();
|
||||||
|
```
|
||||||
|
|
||||||
## 子表 Exists
|
## 子表 Exists
|
||||||
```csharp
|
```csharp
|
||||||
var sql2222 = select.Where(a => select.Where(b => b.Id == a.Id).Any()).ToList();
|
var sql2222 = select.Where(a => select.Where(b => b.Id == a.Id).Any()).ToList();
|
||||||
|
|||||||
Reference in New Issue
Block a user