hi
1 have a table with this structure and data
HTML Code:
ID UserID IP
----------------------------------
1 1 127.0.0.1
2 1 127.0.0.1
3 1 127.0.0.1
4 1 127.0.0.1
5 1 127.0.0.1
6 1 127.0.0.1
7 1 4.2.2.2
8 1 4.2.2.2
9 1 4.2.2.2
10 1 4.2.2.2
11 1 4.2.2.2
12 1 192.168.1.1
1 wrote this query in the Microsoft sql server :
Code:
select
distinct UserID ,IP ,
ROUND(COUNT(IP) / cast((select COUNT(userid) from Users) as float) , 2 ) as '%'
from Users
group by UserID , ip ;
and results is :
HTML Code:
UserID IP %
----------- -------------------- ----------------------
1 127.0.0.1 0.53
1 192.168.0.1 0.42
1 4.2.2.2 0.05
(3 row(s) affected)
i can`t convert it to mysql query
please help me
