Hello friends, Below One is sample structure.Declare @t table( id int, name nvarchar(50), counts int)Insert into @tSelect 1,'AA',16 Union allSelect 2,'BB',14 Union allSelect 3,'cc',60 Union allSelect 4,'dd',19 Union allSelect 5,'ee',2select * from @t
Expecting outputid name counts Result----------- ---------- -----------1 AA 16 14.2857142857142857 2 BB 14 12.50000000000000003 cc 60 53.57142857142857144 dd 19 17.85714285714285715 ee 2 1.7857142857142857Formula for calculating result iscounts/sumofcount *100sumofcount=(16+14+60+19+2) Can any please guide me through sample codeSuri