My db looks like this:
timestamp user_ip user_agent
--------- ------- ----------
2015-09-15 01:11:11 111.111.111.111 bla bla Chrome bla bla
2015-09-15 02:22:22 222.222.222.222 bla bla Chrome bla bla
2015-09-15 04:44:44 222.222.222.222 bla bla Chrome bla bla
2015-09-15 05:55:55 222.222.222.222 bla bla Firefox bla bla
I need to count the same values of user_ip raw. Timestamp and user_agent are just for records inside db.
Expected result:
IP Count
--------------- -----
111.111.111.111 1
222.222.222.222 3
Thanks in advance.
Try this:
Here’s the result:
You can use
GROUP BY
and COUNT() function.