with data as (Select count(*) as total, (Select Count(*)...

0

Please login or register to vote for this query.

(click on this box to dismiss)

SELECT Reputation from Users where Reputation;

Physical Fitness Meta

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

-- Enter Query Title
-- Enter Query Description
-- SELECT Reputation from Users where Reputation;

with data as (Select count(*) as total,
(Select Count(*) from Users where SUBSTRING(CAST(Reputation AS VARCHAR), 1, 1) = '1') as one,
(Select Count(*) from Users where SUBSTRING(CAST(Reputation AS VARCHAR), 1, 1) = '2') as two,
(Select Count(*) from Users where SUBSTRING(CAST(Reputation AS VARCHAR), 1, 1) = '3') as three,
(Select Count(*) from Users where SUBSTRING(CAST(Reputation AS VARCHAR), 1, 1) = '4') as four,
(Select Count(*) from Users where SUBSTRING(CAST(Reputation AS VARCHAR), 1, 1) = '5') as five,
(Select Count(*) from Users where SUBSTRING(CAST(Reputation AS VARCHAR), 1, 1) = '6') as six,
(Select Count(*) from Users where SUBSTRING(CAST(Reputation AS VARCHAR), 1, 1) = '7') as seven,
(Select Count(*) from Users where SUBSTRING(CAST(Reputation AS VARCHAR), 1, 1) = '8') as eight,
(Select Count(*) from Users where SUBSTRING(CAST(Reputation AS VARCHAR), 1, 1) = '9') as nine
from Users ) select
one/total,
two/total,
three/total,
four/total,
five/total,
six/total,
seven/total,
eight/total,
nine/total
from data;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results