如何提高下面语句的效率select * from(select a_month ,b_name ,count(DISTINCT a.c_no) ,dense_rank() over (partition by a_month order by COUNT( DISTINCT a.c_no) desc) rank fromsut_s aleft join cou_c bon a.ll=b.ll where a_month>='10'group by b_

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 21:33:48
如何提高下面语句的效率select*from(selecta_month,b_name,count(DISTINCTa.c_no),dense_rank()over(partitionbya_mont

如何提高下面语句的效率select * from(select a_month ,b_name ,count(DISTINCT a.c_no) ,dense_rank() over (partition by a_month order by COUNT( DISTINCT a.c_no) desc) rank fromsut_s aleft join cou_c bon a.ll=b.ll where a_month>='10'group by b_
如何提高下面语句的效率
select * from
(
select a_month ,b_name ,count(DISTINCT a.c_no) ,
dense_rank() over (partition by a_month order by COUNT( DISTINCT a.c_no) desc) rank from
sut_s a
left join
cou_c b
on a.ll=b.ll
where a_month>='10'
group by b_name,a_month
)where rank

如何提高下面语句的效率select * from(select a_month ,b_name ,count(DISTINCT a.c_no) ,dense_rank() over (partition by a_month order by COUNT( DISTINCT a.c_no) desc) rank fromsut_s aleft join cou_c bon a.ll=b.ll where a_month>='10'group by b_
select a_month ,b_name ,count(DISTINCT a.c_no) ,
dense_rank() over (partition by a_month order by COUNT( DISTINCT a.c_no) desc) rank from
sut_s a
left join
cou_c b
on a.ll=b.ll
where a_month>='10'
group by b_name,a_month
having dense_rank() over (partition by a_month order by COUNT( DISTINCT a.c_no) desc)