牛骨文教育服务平台(让学习变的简单)
博文笔记

sql 出现次数最多排序

创建时间:2015-03-12 投稿人: 浏览次数:1005
SELECT DISTINCT count(*) AS count,ip,keywords,pagefrom,pageurl FROM table
WHERE (
pagefrom like "%baidu.com%"
AND keywords !="" 
AND pageurl like "%/2011%"
AND pageurl not LIKE "%ozc=2%"  
and pageurl not LIKE "%bdlx%"  
and pageurl not LIKE "%bwlx%"  
and pageurl not LIKE "%wdlx%"  
and pageurl not LIKE "%360lx%"  
and pageurl not LIKE "%solx%"  
and pageurl not LIKE "%swlx%"  
and pageurl not LIKE "%smlx%"  
and pagefrom not LIKE "%ozc=2%"  
and pagefrom not LIKE "%bdlx%" 
and pagefrom not LIKE "%bwlx%"  
and pagefrom not LIKE "%wdlx%"  
and pagefrom not LIKE "%360lx%"  
and pagefrom not LIKE "%solx%"  
and pagefrom not LIKE "%swlx%"  
and pagefrom not LIKE "%smlx%")
GROUP BY keywords
ORDER BY  count DESC;

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。