oracle 的语法:select A, sum(N) as B from (select A, (case C when 1 then B when 2 then -1 * B end) as N from t ) tt group by A问题很BT,也不知道怎么整出来的设计!!!
很想帮你但是描述的太不清楚了
自己想