oracle 选择最频繁出现之前,5文章数据
SELECT
*
FROM
(
SELECT
PROJECT_LISTING.MATERIAL,
COUNT (*) AS "出现次数"
FROM
PROJECT_LISTING
WHERE
PROJECT_LISTING.MATERIAL IS NOT NULL
GROUP BY
PROJECT_LISTING.MATERIAL
ORDER BY
COUNT (*) DESC
) WHERE ROWNUM <= 5
ORDER BY
COUNT (*) DESC 是关键排序
COUNT (*) AS "出现次数" 这不能写,只是为了看的清楚
版权声明:本文博主原创文章,博客,未经同意不得转载。