![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Dear Gurus, I have table with following entries Table name = Customer Name Weight ------------ ----------- Sanjeev 85 Sanjeev 75 Rajeev 80 Rajeev 45 Sandy 35 Sandy 30 Harry 15 Harry 45 I need a output as follow Name Weight ------------ ----------- Sanjeev 85 Rajeev 80 Sandy 30 Harry 45 OR Name Weight ------------ ----------- Sanjeev 75 Rajeev 45 Sandy 35 Harry 15 i.e. only distinct Name should display with only one value of Weight. I tried with 'group by' on Name column but it shows me all rows. Could anyone help me for above. Thanking in Advance. Regards Sanjeev sanjeev.atvan... (AT) gmail (DOT) com |
#3
| |||
| |||
|
|
Dear Gurus, I have table with following entries Table name = Customer Name Weight ------------ ----------- Sanjeev 85 Sanjeev 75 Rajeev 80 Rajeev 45 Sandy 35 Sandy 30 Harry 15 Harry 45 I need a output as follow Name Weight ------------ ----------- Sanjeev 85 Rajeev 80 Sandy 30 Harry 45 OR Name Weight ------------ ----------- Sanjeev 75 Rajeev 45 Sandy 35 Harry 15 i.e. only distinct Name should display with only one value of Weight. I tried with 'group by' on Name column but it shows me all rows. Could anyone help me for above. Thanking in Advance. Regards Sanjeev sanjeev.atvan... (AT) gmail (DOT) com |
#4
| |||
| |||
|
|
Dear Gurus, I have table with following entries Table name = Customer Name Weight ------------ ----------- Sanjeev 85 Sanjeev 75 Rajeev 80 Rajeev 45 Sandy 35 Sandy 30 Harry 15 Harry 45 I need a output as follow Name Weight ------------ ----------- Sanjeev 85 Rajeev 80 Sandy 30 Harry 45 OR Name Weight ------------ ----------- Sanjeev 75 Rajeev 45 Sandy 35 Harry 15 i.e. only distinct Name should display with only one value of Weight. I tried with 'group by' on Name column but it shows me all rows. Could anyone help me for above. Thanking in Advance. Regards Sanjeev sanjeev.atvan... (AT) gmail (DOT) com |
#5
| |||
| |||
|
|
Please note that because you don't care which weight you get, max() can be replaced with min(), first(), last(), etc. Cheers, Jason Lepack On Nov 28, 8:26 am, sanjeev.atvan... (AT) gmail (DOT) com wrote: Dear Gurus, I have table with following entries Table name = Customer Name Weight ------------ ----------- Sanjeev 85 Sanjeev 75 Rajeev 80 Rajeev 45 Sandy 35 Sandy 30 Harry 15 Harry 45 I need a output as follow Name Weight ------------ ----------- Sanjeev 85 Rajeev 80 Sandy 30 Harry 45 OR Name Weight ------------ ----------- Sanjeev 75 Rajeev 45 Sandy 35 Harry 15 i.e. only distinct Name should display with only one value of Weight. I tried with 'group by' on Name column but it shows me all rows. Could anyone help me for above. Thanking in Advance. Regards Sanjeev sanjeev.atvan... (AT) gmail (DOT) com- Hide quoted text - - Show quoted text - |
![]() |
| Thread Tools | |
| Display Modes | |
| |