Hi Guys,
Here is my sample table and data.
Create table #TempInvoice
(
id int identity (1,1),
Tkey int,
Status varchar(25),
Amount float
)
Insert into #TempInvoice (Tkey,Status,Amount)
VALUES (2331,'SecondTry',23.00),
(2331,'ThirdTry',21.00),
(2331,'Transfer',18.00)
Select * from #TempInvoice
Drop table #TempInvoice
However, Here what I want in my select statement.
ID,Tkey,Status,Amount
1,2331,SecondTry,23
2,2332,ThirdTry,21
3,2331,Transfer,18
4,2331,First,23
I want to just add the last row with same information just changing the status to "First" any advice? The amount could be coming from Top 1