怎么合并记录呀~~~~~刚揭帖一个,再开一个贴
select tt.dlr_code,tt.part_order_type,
sum(tt.PART_ORDER_AMOUNT) as TOTAL_AMOUNT,
round(RATIO_TO_REPORT(sum(tt.PART_ORDER_AMOUNT)) over() * 100, 2) || '% ' as percent
from owndmssem.TT_SEM_PT_DLRORDER tt
group by tt.dlr_code,tt.part_order_type;这个是我增加的一个dlr_code是经销商的代码
上面的语句运行的结果是
DIR_CODE part_order_type TOTAL_AMOUNT percent
(经销商代码)
A1 A 122 32.4%
A1 D 156.2 56%
A1 T 441.3 65.3%
A2 A 5656 89%
A3 Z 54565 7%
希望把上面4个相同的AAA04合并成一个记录
[解决办法]
我刚给你回的,啥意思啊?