mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-31 15:56:25 +08:00
Update Mysql
This commit is contained in:
parent
c07ab9298d
commit
f87ece6d84
@ -174,6 +174,8 @@ namespace OrmTest.Demo
|
||||
var list3 = db.Queryable<Student>()
|
||||
.PartitionBy(it => new { it.Id, it.Name }).Take(1).ToList();
|
||||
|
||||
var list31 = db.Queryable<Student>()
|
||||
.PartitionBy(it => new { it.Id, it.Name }).Take(1).Count();
|
||||
|
||||
//SQL:
|
||||
//SELECT AVG([Id]) AS[idAvg], [Name] AS[name] FROM[Student] GROUP BY[Name],[Id] HAVING(AVG([Id]) > 0 )
|
||||
|
@ -65,7 +65,14 @@ namespace SqlSugar
|
||||
}
|
||||
public override string ToCountSql(string sql)
|
||||
{
|
||||
return Regex.Replace(sql,"^SELECT .+? FROM ", "SELECT COUNT(*) FROM ");
|
||||
if (this.GroupByValue.HasValue())
|
||||
{
|
||||
return base.ToCountSql(sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Regex.Replace(sql, "^SELECT .+? FROM ", "SELECT COUNT(*) FROM ");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user