在pgsql 子查询排序问题 返回
var resultQueryNewData = resultQuery.Select((x) => new t_sntestvalue_status
{
createdate = x.createdate,
sn = x.sn,
station = x.station,
testresult = x.testresult,
testvalue = x.testvalue,
islastflag = x.islastflag,
mahineno = x.mahineno,
projectno = x.projectno,
numberOfTimes = x.numberOfTimes,
processtag = x.processtag,
#region 增加子查询..
sntree = SqlFunc.Subqueryable<t_snTree>()
.Where(t => t.sn == x.sn)
.OrderBy(t=>t.createdate)
.SelectStringJoin(t => t.sntree, ",")
#endregion
});
在子查询中增加排序 查询报错 column "t.createdate" must appear in the GROUP BY clause or be used in an aggregate function 我写原生sql查询 改成
(SELECT string_agg(("sntree")::text, ',' ORDER BY "t"."createdate")就可以了 但是sqlsugar 中SelectStringJoin 并没有
此场景重载,sqlsugar版本是 5.1.4.93 数据库是pgsql
热忱回答(3)
-
fate sta VIP0
2周前升级最新看看
0 回复 -
上瘾 VIP0
2周前更新了 5.1.4.207 还是不行
0 回复 -
上瘾 VIP0
2周前针对于pgsql 子查询排序的场景 现有框架是否有解决方案 没有的话 我就写原生sql了
0 回复