sql top_10_hosts.sql

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql top_10_hosts.sql相关的知识,希望对你有一定的参考价值。

-- Firefox saves your browsing history data in places.sqlite. So it's 
-- possible to know about your behavior by a sql select statement.
-- Here is an example.
-- 
-- (https://support.mozilla.org/en-US/kb/recovering-important-data-from-an-old-profile)
--

SELECT host, count(*) FROM moz_historyvisits h LEFT JOIN
  (SELECT id, substr(substr(url, instr(url,'://')+3),
                     0,instr(substr(url, instr(url,'://')+3),'/')) AS host
   FROM moz_places WHERE substr(url,0,5) = 'http') p ON h.place_id = p.id
GROUP BY host ORDER BY count(*) DESC LIMIT 10;

以上是关于sql top_10_hosts.sql的主要内容,如果未能解决你的问题,请参考以下文章

[Demo_01] MapReduce 实现密码 Top10 统计

sql每月选择前5名

py07_10:class之综合小案例

SQL Server MERGE 语句和 ORDER BY 子句

系统状态类_top

SQL的top语句