SQL语句--分组的Top查询

SQL语句--分组的Top查询
代码

SELECT A.*
FROM
(
    SELECT ROW_NUMBER() OVER(PARTITION BY Host ORDER BY Host,count(EntranceURL) DESC) AS ROW,
    Host, 
    EntranceURL as PageURL
    ,count(EntranceURL) as EnterTimes
    ,sum(CASE WHEN IsBounce=1 THEN 1 ELSE 0 END ) AS BounceTimes
    FROM UserLoyalty
    GROUP BY Host,EntranceURL
) A
WHERE A.ROW<=100
SQL语句--分组的Top查询

 

SQL语句--分组的Top查询,布布扣,bubuko.com

SQL语句--分组的Top查询

上一篇:WebMisCentral-Client 适配MySql数据库


下一篇:geoserver 安装 sql server 插件