with x as ( select id, type, count(1) cnt from ( select 1...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Chess Meta

Q&A about the site for serious players and enthusiasts of chess

with x as (
select id, type, count(1) cnt
from (
select 1 id, 'upmod' type union all
select 1, 'upmod' union all
select 1, 'upmod' union all
select 2, 'upmod' union all
select 2, 'upmod' union all
select 3, 'upmod' union all
select 3, 'upmod' union all
select 3, 'upmod' ) s
group by id, type)
select rank() over (partition by type order by cnt desc) rnk, type, id
from x

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results