Click here to Skip to main content
15,895,962 members

Comments by IsaiSelvan (Top 36 by date)

IsaiSelvan 7-May-18 4:17am View    
ok thank you for reply.
IsaiSelvan 7-May-18 2:56am View    
Kindly help on this.Because last few days am trying but no result. But, without using pivot and unpivot functionality.
IsaiSelvan 4-May-18 6:43am View    
thank you for your reply.i'm trying to find the solution for this one. But i'm getting wrong value. i've one question for this query. Is it possible to find the median value for row based in a table?.
IsaiSelvan 4-May-18 6:14am View    
thank you for your reply. that shows the column based median value finding. But i want the row based median value.
IsaiSelvan 4-May-18 5:56am View    
Yes i want to get median for each row.

First Row - 1,5,6,7,8,2,6,3,4,5,2,1,6,5,7,8,2,7,6,2,8

Actuval Value - 4.80 (this is wrong)
Expected value - 5 (Correct Output)

Second Row- 1,5,6,7,8,2,2,3,2,4,2,1,4,5,9,8,2,7,6,2,8

Actual Value - 4.47 (this is wrong)
Expected Value - 4 (Correct Output)


Create table Script
===================
create table temp (id int identity(1,1), a decimal(6,2),b decimal(6,2),c decimal(6,2),d decimal(6,2),e decimal(6,2),f decimal(6,2),g decimal(6,2),h decimal(6,2),i decimal(6,2),j decimal(6,2),k decimal(6,2),l decimal(6,2),m decimal(6,2),n decimal(6,2),o decimal(6,2),p decimal(6,2),q decimal(6,2),r decimal(6,2),
s decimal(6,2),t decimal(6,2),u decimal(6,2))

Insert Table Script:
====================
insert into temp (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) values (1,5,6,7,8,2,6,3,4,5,2,1,6,5,7,8,2,7,6,2,8)
insert into temp (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) values (1,5,6,7,8,2,2,3,2,4,2,1,4,5,9,8,2,7,6,2,8)