[ 수량 비율로 금액 배분 후 끝전 처리를 쿼리로 만들기 ] 1) cloth_cd별로 가지고 있는 수량 비율을 구해 금액을 나눈다( ratio_to_report 사용 ) cloth_cd의 rownumber와 마지막 로우를 찾기 위해 count(cloth_cd)를 구해 놓는다 round(d.othr_amt8 * round(ratio_to_report(a.out_qty) over(partition by a.cloth_cd), 6)) out_amt, row_number() over(partition by a.cloth_cd order by a.out_qty) last_row, count(a.cloth_cd) over(partition by a.cloth_cd) row_cnt 2) cloth_cd별로 마지막 r..