top n with ties

0

Please login or register to vote for this query.

(click on this box to dismiss)

Monero Meta

Q&A about the site for developers and users of the secure, private and untraceable cryptocurrency Monero

declare @numbers table(nums integer);
insert into @numbers  values (10), (9), (9), (8), (2), (10);
 

select top 3 WITH TIES * from @numbers order by nums DESC

/*
select nums
from ( 
  select nums,
         rank() over (order by nums desc) as rn
  from @numbers
) t
where rn <= 3;
*/

Enter Parameters

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