人大金仓数据库 返回

这是生成的 sql 语句 :string_agg( pg_catalog.concat( pg_catalog.concat( pg_catalog.concat( pg_catalog.concat( N'【' ,"adtpt"."pay_type_name") , N':' ) , CAST(FORMAT("ttpt"."trade_money", '0.00', 'en-US') AS VARCHAR(MAX))) , N'】' ) , '|') AS "TradePayTypeInfo"
为什么这里能生成这个格式的PayInfo。。。
热忱回答(10)
-
zssc VIP0
1周前fate 哥来看看
0 回复 -
fate sta VIP0
1周前人大金仓是什么模式 ,并且版本号是多少
并且正确SQL什么样,现在错误的是什么样讲清楚
0 回复 -
zssc VIP0
1周前模式为:SQL server 模式
版本: KingbaseES V009R004C011
人大金仓:生成的SQL为:
SELECT
"ttpt"."order_id" AS "OrderId" ,
"ttpt"."trade_id" AS "TradeId" ,
"ttpt"."organization_id" AS "OrganizationId" ,
string_agg( pg_catalog.concat( pg_catalog.concat( pg_catalog.concat( pg_catalog.concat( N'【' ,"adtpt"."pay_type_name") , N':' ) , FORMAT("ttpt"."trade_money", 'F2', 'en-US')) , N'】' ) , '|') AS "TradePayTypeInfo"
FROM
"t_trade_pay_type" "ttpt"
LEFT JOIN "v6peis_localdata"."dbo"."a_dic_trade_pay_type" "adtpt" ON
(
"adtpt"."pay_type_code" = "ttpt"."trade_pay_type"
)
WHERE
(
(
"ttpt"."organization_id" = N'qlyydzrmyy01'
)
AND (
"ttpt"."trade_status" = 1
)
)
GROUP BY
"ttpt"."order_id",
"ttpt"."trade_id",
"ttpt"."organization_id"
TradePayTypeInfo:【扫码付:1900-01-02】
SQL server 数据库下生成的 sql为
SELECT
[ttpt].[order_id] AS [OrderId],
[ttpt].[trade_id] AS [TradeId],
[ttpt].[organization_id] AS [OrganizationId],
string_agg ( N'【' + [adtpt].[pay_type_name] + N':' + FORMAT ( [ttpt].[trade_money], 'F2', 'en-US' ) + N'】', '|' ) AS [TradePayTypeInfo]
FROM
[t_trade_pay_type] [ttpt] WITH ( NOLOCK )
LEFT JOIN [v6peis_localdata].[dbo].[a_dic_trade_pay_type] [adtpt] WITH ( NOLOCK ) ON ( [adtpt].[pay_type_code] = [ttpt].[trade_pay_type] )
WHERE
( ( [ttpt].[organization_id] = N'qlyydzrmyy01' ) AND ( [ttpt].[trade_status] = 1 ) )
GROUP BY
[ttpt].[order_id],
[ttpt].[trade_id],
[ttpt].[organization_id]
TradePayTypeInfo:【扫码付:494.00】
这种格式0 回复 -
fate sta VIP0
1周前-
0 回复 -
fate sta VIP0
1周前-
0 回复 -
fate sta VIP0
1周前SqlSugarCore 5.1.4.183-preview10
过五分钟勾一下预览 ,已支持新版金仓数据库的+操作
0 回复 -
zssc VIP0
1周前扩展的 就是SQL server 的string_agg,问题不是出在这里呢 是【扫码付:494.00】 的数值计算,toString("F2") 后计算并没有做数值的处理
SELECT
"ttpt"."order_id" AS "OrderId",
"ttpt"."trade_id" AS "TradeId",
"ttpt"."organization_id" AS "OrganizationId",
FORMAT(
"ttpt"."trade_money",
'F2',
'en-US'
) AS "ASSS"
FROM
"t_trade_pay_type" "ttpt"
LEFT JOIN "v6peis_localdata"."dbo"."a_dic_trade_pay_type" "adtpt" ON
"adtpt"."pay_type_code" = "ttpt"."trade_pay_type"
WHERE
"ttpt"."organization_id" = N'qlyydzrmyy01'
AND "ttpt"."trade_status" = 1
GROUP BY
"ttpt"."order_id",
"ttpt"."trade_id",
"ttpt"."organization_id",
"ttpt"."trade_money"
就像这里 我这里是这样写的0 回复 -
fate sta VIP0
1周前toString("F2")
这个函数不支持,需要你用自定函数。
sqlsugar只是在select(it=>new {it=it.xx.tostring("f2")}) 这一种情况支持了因为是生成SQL后内存调用的C#方法
0 回复 -
zssc VIP0
6天前SqlSugarCore 5.1.4.183-preview10
升级这个版本后导致这个语句生成的
SELECT "ttpt"."order_id" AS "OrderId" , "ttpt"."trade_id" AS "TradeId" , "ttpt"."organization_id" AS "OrganizationId" , pg_catalog.concat(( N'【' +"adtpt"."pay_type_name" + N':' + "ttpt"."trade_money" )+ N'】',N'|') AS "TradePayTypeInfo" FROM "t_trade_pay_type" "ttpt" Left JOIN "v6peis_localdata"."dbo"."a_dic_trade_pay_type" "adtpt" ON ( "adtpt"."pay_type_code" = "ttpt"."trade_pay_type" ) WHERE (( "ttpt"."organization_id" = N'qlyydzrmyy01' ) AND ( "ttpt"."trade_status" = 1 ))GROUP BY "ttpt"."order_id","ttpt"."trade_id","ttpt"."organization_id"
不正确了,需要额外的group bytoString("F2")
这个函数不支持,需要你用自定函数。
sqlsugar只是在select(it=>new {it=it.xx.tostring("f2")}) 这一种情况支持了因为是生成SQL后内存调用的C#方法
这句话可以理解为在人大金仓数据库中不支持这样操作吗,因为在SQL server 数据库中toString("F2") 确实会转化为函数FORMAT ( "ttpt"."trade_money", 'F2', 'en-US' )0 回复 -
fate sta VIP0
6天前可能不支持
0 回复