Thread: country column
View Single Post
  #2  
Old 11-28-2006, 05:01 AM
inder inder is offline
Senior Member
 
Join Date: Sep 2006
Posts: 113
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 17
inder is on a distinguished road
Default

Try the following:
SELECT country, count(1)/(SELECT COUNT(*) FROM countries)*100.0 AS pct
FROM countries GROUP BY country -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - country column
Thread: country column
View Single Post
  #2  
Old 11-28-2006, 05:01 AM
inder inder is offline
Senior Member
 
Join Date: Sep 2006
Posts: 113
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 17
inder is on a distinguished road
Default

Try the following:
SELECT country, count(1)/(SELECT COUNT(*) FROM countries)*100.0 AS pct
FROM countries GROUP BY country -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote