Link to home
Create AccountLog in
Avatar of Sathish David  Kumar N
Sathish David Kumar NFlag for India

asked on

How to get correct output if this condition

i want to  run some query if same user name exits then

i want get the max value that group and update in g1 .

how to get this ??

example below

Name         group          n1          n2    n3   n4   g1
Sathish        n1               4           5       6    7        
kumar          n2               5           7       8     9    
Sathish        n3              6           8        9     19  
Sathish        n1               4           5       6    7          
kumar          n2               5           7       8     9    
Sathish        n4              6           8        9     19  

this is input,
here 4 sathish and 2 kumar are there but group are some what diffrent in sathish case . only 2 group are equal


so 1st want to check name after that group  
eg sathish n1
so i want take values in n1  and update in g1 but

sathish and group n1 repeat then i want  to get max value of that .

so output coming like this

Sathish        n1              6           5       6    7        6        
kumar          n2               5           7       8     9       7
Sathish        n3              6           8        9     19     9  
Sathish        n1               4           5       6    7        6        
kumar          n2               5           7       8     9       7
Sathish        n4              6           8        9     19    19

 


Avatar of Qlemo
Qlemo
Flag of Germany image

Please recheck your example for errors. I cannot get any sense out of it currently.
Avatar of Sathish David  Kumar N

ASKER

Why what is wrong in that ??
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer