这是我的表格“AuctionDetails”
以下选择:
select string_agg("AuctionNO",',' ) as "AuctionNO"
,sum("QuntityInAuction" ) as "QuntityInAuction"
,"AmmanatPattiID"
,"EntryPassDetailsId"
,"BrokerID"
,"TraderID"
,"IsSold"
,"IsActive"
,"IsExit"
,"IsNew"
,"CreationDate"
from "AuctionDetails"
group by "AmmanatPattiID"
,"EntryPassDetailsId"
,"TraderID"
,"IsSold"
,"IsActive"
,"IsExit"
,"IsNew"
,"BrokerID"
,"CreationDate"
给了我这个结果:
但我需要像这样的记录
AuctionNo QunatityInAuction AmmanatpattiID EntryPassDetailID BrokerID Trader ID IsSold ISActive ISExit IsNew CreationDate
AU8797897,AU8797886,AU596220196F37379 1050 -1 228,229 42 42 f t f t 2013-10-10
最后,我需要一个最新的交易者和经纪人条目,在我们的例子中是“42”,数量总和,以及拍卖编号的串联......