在一个 SQL 查询中获取 Uniqie 视图和视图

发布于 2024-12-08 12:12:03 字数 245 浏览 0 评论 0原文

我想在单个查询中检索 uniqie 视图和视图。 我当前检索视图的查询看起来像这样,但我也想用它检索唯一的视图。

IP 地址字段称为 IP

SELECT `time` - `time` % 86400 AS Date, count(*) AS Views 
    FROM `bvcms_pageviews` 
    WHERE 1=1 
    GROUP BY Date

最好的问候

I would like to retrive uniqie views and views in a single query.
My current query to retrive views looks like this, but i would also like to retrieve unique views with it.

The field to the IP address is called IP

SELECT `time` - `time` % 86400 AS Date, count(*) AS Views 
    FROM `bvcms_pageviews` 
    WHERE 1=1 
    GROUP BY Date

Best regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋凉 2024-12-15 12:12:03

唯一IP查看数据?选择“Distinct”将有助于

 SELECT DISTINCT IP, `time` - `time` % 86400 AS Date, count(IP) AS
 Views FROM `bvcms_pageviews` WHERE 1=1 GROUP BY Date

http://www.sql-tutorial。 com/sql-distinct-sql-tutorial/

Unique IP view data? Selected 'Distinct' would help with this

 SELECT DISTINCT IP, `time` - `time` % 86400 AS Date, count(IP) AS
 Views FROM `bvcms_pageviews` WHERE 1=1 GROUP BY Date

http://www.sql-tutorial.com/sql-distinct-sql-tutorial/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文