我在单个游标中有以下数据,但我想将此数据写入另一个表中,每个成员都有一行。
查询:
SELECT member__c, partner_category__c ,
COALESCE( NULLIF(to_char(activity_transaction_date__c,'Mon'),'') , 'Mon' ) as month ,to_char(activity_transaction_date__c,'YYYY') as year ,
COALESCE( NULLIF(sum(transaction_reward__c),0) , '0' ) as prog_amt,
exported_id__c,sfid
FROM h_activity1
GROUP BY member__c,partner_category__c,month,year,exported_id__c,sfid
ORDER BY month,member__c,partner_category__c,year,exported_id__c,sfid;
每个类别的总数应填入相应的列和对于每个成员,应该只有1行。如屏幕截图所示