So, i have the following structure of my table:
id user_agent user_ip
---------------------
18 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4 4.3.2.1
13 Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4 1.2.3.4
How i can find only unique values based on two columns(user_agent and user_ip) and count of it? I just tried following solution:
SELECT user_agent, COUNT(*) c FROM statistics GROUP BY user_agent, user_ip HAVING c > 1;
But it won't work as i desired. Any help will be appreciated. Thanks.