

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I count visitors per page per day using MySQL?
Note: We assume we have created a database named ‘DBNAME’ and a table named ‘tableName’.
Let us understand how the count of visitors per day per page can be queried using MySQL. This can be done using the bit group function −
Query
SELECT DATE(date) Date, page_id, COUNT(*) colName FROM tableName GROUP BY DATE(date), page_id
Here ‘colName’ refers to the ‘visits per day’ column, and ‘tableName’ refers to the table that contains details about visitors.
It makes sure that the duplicate values in the table are removed when the above query is run.
- Related Questions & Answers
- Converting km per hour to cm per second using JavaScript
- MySQL - How to count all rows per table in one query?
- Converting miles per gallon to kilometer per liter in JavaScript
- Count unique values per groups in Python Pandas
- Maximum of Column per Group in MySQL
- SQL queries for counter web visits per day, month, year and totals
- Differentiate between Earnings per share (EPS) and dilute Earnings per share (D-EPS).
- How to count number of distinct values per field/ key in MongoDB?
- How can we combine multiple print statements per line in Python?
- How to limit Database Resources per Session in Oracle?
- Which gods or goddesses are associated with which day of the week as per Hindu mythology?
- Explain Earnings per share (EPS) in financial management.
- MySQL SELECT products WHERE 'average price per product' < value?
- How to list one filename per output line in Linux?
- How to automatically redirect your visitors to your new home page?
Advertisements