在Excel中运用SQL提取正跟负抵消了之后的那些纪录

2025-02-02 15:08:21
推荐回答(1个)
回答1:

来晚了,测试过啦
select * from [Sheet1$] a where
(select sum(金额) from [Sheet1$]
where 序号<=a.序号 and 姓名=a.姓名 and abs(金额)=a.金额)>0
and(
select sum(金额) from [Sheet1$]
where 姓名=a.姓名 and abs(金额)=a.金额)>0 and 金额>0