Not to sum last inserted Record.

Analyst_SQL 3,531 Reputation points
2021-04-08T11:55:36.507+00:00

i want to not sum last inserted in table against I_ID column.

I_ID=222 ,have three value 500 ,600 and 400. i have inserted last value 400 against I_ID ,which should not be sum and result will be 1100.

Create TABLE #Tbl_IB_Cus_Libility (Li_ID int,I_ID int,I_Amt int)
Insert into #Tbl_IB_Cus_Libility values (1,222,500)
Insert into #Tbl_IB_Cus_Libility values (2,222,600)
Insert into #Tbl_IB_Cus_Libility values (3,222,400)
Insert into #Tbl_IB_Cus_Libility values (4,225,200)
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,668 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,552 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful