Skip to content

Commit 3fee7c3

Browse files
Time: 3311 ms (43.78%), Space: 0B (100%) - LeetHub
1 parent c500081 commit 3fee7c3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* Write your T-SQL query statement below */
2+
declare @total decimal(8,2) = (select count(user_id) from Users)
3+
4+
select
5+
contest_id,
6+
Round((count/@total)* 100, 2) percentage
7+
8+
from (
9+
select
10+
contest_id,
11+
count(user_id) count
12+
from Register
13+
group by contest_id
14+
) as data
15+
16+
order by percentage desc, contest_id asc

0 commit comments

Comments
 (0)