Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否实现 CTEs ,嵌套查询生成的sql , 索引容易匹配不正确 #1769

Open
zhujiancc opened this issue Apr 2, 2024 · 4 comments

Comments

@zhujiancc
Copy link

Feature 特性

with as

简要描述原因

索引匹配不好

使用场景

复杂的联表查询

@2881099
Copy link
Collaborator

2881099 commented Apr 2, 2024

tosql + astable

@zhujiancc
Copy link
Author

有没有使用案例 , 没懂这两个如何一起使用

@zhujiancc
Copy link
Author

tosql+ astable , 感觉用起来不是很舒服 ,能不能提供类似下面这样的语法

_context.Select<Users>()
            .WithAs(
                _context.Select<UserRoleMap>()
                    .WithTempQuery(s => new
                    {
                        s.RoleId,s.UserId
                    })
            )
            .WithAs(
                _context.Select<Roles>()
                    .WithTempQuery(s => new
                    {
                        s.Id
                    })
            )
            .InnerJoin(s => s.t1.Id == s.t2.UserId)
            .InnerJoin(s => s.t2.RoleId == s.t3.Id)
            .ToList(s=>new
            {
                ...
            })

@2881099
Copy link
Collaborator

2881099 commented Apr 8, 2024

先记录

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants