Quantcast
Channel: sum of two column
Browsing all 8 articles
Browse latest View live

sum of two column

hi Banty,you can try this query,selecta.id,a.Price1, a.Price2,a.Price1+b.Price2from @temp aLeftjoin @temp bon a.id-1= b.id

View Article



sum of two column

now there is a little change i want to insert new value into one column downresult set would be ID   Price1    Price2    SumColumn 1        2          3          2        3         6          (3+3=6)...

View Article

sum of two column

Tryselect id,price1,price2,(select a.price1+b.price2 from tab1 b where a.id-1=b.id) sumcolumn from tab1 a;Many Thanks & Best Regards, Hua Min

View Article

sum of two column

now there is a little change i want to insert new value into one column downresult set would be ID   Price1    Price2    SumColumn 1        2          3          2        3         6          (3+3=6)...

View Article

sum of two column

now there is a little change i want to insert new value into one column downresult set would be ID   Price1    Price2    SumColumn 1        2          3          2        3         6          (3+3=6)...

View Article


sum of two column

Hi,If you are on SQL Server 2012,try like this,DECLARE @TMP TABLE(ID INT,Price1 INT,Price2 INT) INSERT @TMP SELECT 1,2,3 INSERT @TMP SELECT 2,3,6 INSERT @TMP SELECT 3,5,7 SELECT ID,Price1,Price2,LEAD...

View Article

sum of two column

Tryselect id,price1,price2,isnull((select a.price2+b.price1 from tab1 b where a.id+1=b.id),a.price2) sumcolumn from tab1 a;Many Thanks & Best Regards, Hua Min

View Article

sum of two column

HiI have table likeID   Price1    Price21        2          32        3         63        5          7I want to populate third column whose value would be 2nd record from Price1 and first record from...

View Article

Browsing all 8 articles
Browse latest View live




Latest Images