FamousMortimer
asked on
SQL - Show Quantity on last line of Item Group
Hi Experts, consider this example
Desired Output is as follows...
ItemNumber|Quantity
ABC |100
DEF |NULL
DEF |NULL
DEF |200
GHI |NULL
GHI |500
Thanks
-FM
declare @t table
(
ItemNumber varchar(8),
EntryDate date,
Qty int
)
insert into @t
values ('abc',
'8/1/2013',
100),
('def',
'8/3/2013',
200),
('def',
'8/5/2013',
200),
('def',
'8/7/2013',
200),
('ghi',
'8/4/2013',
500),
('ghi',
'8/5/2013',
500)
select *
from @t
Desired Output is as follows...
ItemNumber|Quantity
ABC |100
DEF |NULL
DEF |NULL
DEF |200
GHI |NULL
GHI |500
Thanks
-FM
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks