Re: Select distinct rows from duplicate rows....



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...@xxxxxxxxx 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...@xxxxxxxxx

.



Relevant Pages

  • Re: Does losing weight cure Type 2?
    ... I don't think there are many in the civilized world who haven't struggled with weight from time to time. ... Mary, I believe you care, and I hope you don't get insulted by this comment, but you really need to learn just a little more about type 2. ... There definitely is a different kind of carbohydrate induced hunger that out of control type 2's experience. ... Even as a "Type 1" I eat low carb, and I know that the hunger is kept under control by this regimen. ...
    (alt.support.diabetes)
  • Re: OT proposed discussion: How did you learn to be a "woman" rather than a "girl"?
    ... Sherry Starr wrote: ... appearance they don't care about the way they look. ... The weight was put on due to ...
    (rec.crafts.textiles.quilting)
  • Re: OK, what say a truce?
    ... because Charlie can't help being programmed ... I know my own weight and you clearly misunderstood ... I really don't care to dwell on your weight ... >> Drone, drone, drone. ...
    (rec.music.beatles)
  • Re: Ping:Hawki
    ... agreement that a NP is worth their weight in gold. ... listening that most MD's are. ... >OG, take care, you have been through much worse and you are ...
    (alt.support.chronic-pain)
  • Re: Consequence of shifting carry-on luggage to checked luggage for aircraft weight
    ... characteristics and might also waste fuel (since more would be loaded ... I don't care about weight and balance. ...
    (rec.aviation.piloting)