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
        ,SUM(Amount)
from    @t
group   by [Name], Amount

Enter Parameters

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