sql 是这select store_no,buyer_uid,art_grp_no, art_no,descr, sum(xs), mc
from (
select store_no,buyer_uid,art_grp_no, art_no,descr, sum(sale_amount) xs,
rank()over(partition by store_no,buyer_uid,art_grp_no order by sum(sale_amount) desc) mc from jxc_art where run_date= to_date(&&1,'yyyymmdd') and store_no=10
group by store_no,buyer_uid,art_grp_no, art_no,descr having sum(sale_amount)<>0
)
where mc<=30
group by store_no,buyer_uid,art_grp_no, art_no,descr,mc
order by 1,2,3,7 急急急急急急作者: langren868 时间: 2011-01-12 15:07
SQL 给你写出这样,也真是无语。。。。。。7在哪,我怎么没看到?