在Excel中运用SQL提取正跟负抵消了之后的那些纪录
我写了如下 select * from [Sheet1$] a where not exists (select 1 from [Sheet1$] where 序号>=a.序号 and -金额=a.金额) and 金额>0 但是结果不对。
我写了如下 select * from [Sheet1$] a where not exists (select 1 from [Sheet1$] where 序号>=a.序号 and -金额=a.金额) and 金额>0 但是结果不对。
答案:来晚了,测试过啦
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
上一个:关于EXCEL数据库建立与运用的问题
下一个:1、PowerPoint 2003中可以插入以下______对象。 A:Access文档 B:Excel文档 C:Word文档 D:其它Windows