Testing

0

Please login or register to vote for this query.

(click on this box to dismiss)

SELECT Reputation from Users where Reputation;

Ask Ubuntu

Q&A for Ubuntu users and developers

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

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

Enter Parameters

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