SQLTeam.com | Weblogs | Forums

Divide row 1 by row 2


#1

Row1 values(10,20,30, 40..... Nth)
Row 2 values (40,50,60.... Nth)
Row3 divide row1/row2 in sql


#2

This sounds very much like homework.

What have you written so far to try to do this?


#3

Help me out


#4
Row3 = Row1/Row2

#5

create table #TestMuj (Row1 int,Row2 int )

insert into #TestMuj
values (10,40),(20,50),(30,60),(40,70),(50,80),(60,90)

select row1,row2,convert(float,[row1])/convert(float,[row2]) as Row3 from #TestMuj