select * from(
select fpp.project_num,count(*)
from odssale.fin_payment_plan fpp
where fpp.project_num is not null
group by fpp.project_num
order by count(*) asc/desc
)
where rownum<=5
如上
本文深入探讨了SQL查询语句的高级用法,包括如何使用子查询、聚合函数和排序功能来从数据库中高效地检索特定项目信息。通过具体实例,讲解了如何按项目编号分组并统计每个项目的数量,同时展示了如何对结果进行升序或降序排列,并限制返回的行数。
select * from(
select fpp.project_num,count(*)
from odssale.fin_payment_plan fpp
where fpp.project_num is not null
group by fpp.project_num
order by count(*) asc/desc
)
where rownum<=5
如上
340

被折叠的 条评论
为什么被折叠?