-
Notifications
You must be signed in to change notification settings - Fork 861
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
有没有多表关联查询后 然后union all 其他多表关联操作的处理方式 #432
Comments
var sql1 = fsql.Select<T>().ToSql();
var sql2 = fsql.Select<T2>().ToSql();
var list = fsql.Select<T>()
.WithSql(sql1).WithSql(sql2).ToList(); |
fsql.Select<T,T1,T2,T3...>() 没有withsql 方法 |
union all 应该先把多表结果汇总,因为每个结果集返回的字段应该要一致。 再用单表 WithSql。 var sql1 = fsql.Select<T1, T2, T3>().ToSql((a,b,c) => new { 返回一样的字段 }, FieldAliasOptions.AsProperty);
var sql2 = fsql.Select<T4, T5, T6>().ToSql((a,b,c) => new { 返回一样的字段 }, FieldAliasOptions.AsProperty);
var list = fsql.Select<T>()
.WithSql(sql1).WithSql(sql2).ToList(); |
在pgsql中 形成的 连接sql语句有问题 形成的sql语句比如 select “A” from ( 另外union all 后有没有方法进行 分页 |
pgsql 建议都用小写,FreeSqlBuilder UseNameConvert 可以设置。 Union All 分页,可以再 ToSql WithSql 套一层 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
有一个结果集是两个多表查询结果的并集 不用sql语句处理,freesql有处理方式吗
The text was updated successfully, but these errors were encountered: