|
楼主 |
发表于 2015-3-28 14:56
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
hope9966 发表于 2015-3-26 15:11
select 产品,iif(总金额 is null,null,(select 1+count(*) from (select x.产品,sum(金额) as 总金额 from ... - select 产品,iif(总金额 is null,"无排名",(select 1+count(*) from (select x.产品,sum(金额) as 总金额 from [产品资料$]x right join [出库$]y on x.产品=y.产品 group by x.产品)b where b.总金额>a.总金额)) as 排名,总金额 from (select x.产品,sum(金额) as 总金额 from [产品资料$]x left join [出库$]y on x.产品=y.产品 group by x.产品)a order by 3 desc
复制代码 把iif里面的null改了成了无排名
搞定 |
|