declare @t table ([Name] varchar(1), Amount int) insert i...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

declare @t table ([Name] varchar(1), Amount int)
insert into @t values ('a', 100)
insert into @t values ('b', 300)
insert into @t values ('c', 250)


select
    name
,   amount
,   row_number() over (partition by Amount order by Amount)
from @t

Enter Parameters

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