Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
obedrodriguez
Starting Member
9 Posts |
Posted - 2007-11-15 : 17:04:39
|
Help me with this I have this table Name Num DescriptionPeter 7 Approved by Commercial ServicesNorman 1 Original CalculationJohn 1 Original CalculationKevin 1 Original CalculationJohn 7 Approved by Commercial ServicesPeter 1 Original CalculationI want this result Name Num DescriptionPeter 7 Approved by Commercial ServicesNorman 1 Original CalculationKevin 1 Original CalculationJohn 7 Approved by Commercial ServicesI try a diffent times with max function I dont know if I using correctly I know ia have to do it with the max an group but how I do it. Thank you for the help. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-11-15 : 17:25:00
|
[code]select t.*from table t inner join ( select Name, Num = max(Num) from table group by Name ) m on t.Name = m.Name and t.Num = m.Num[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
obedrodriguez
Starting Member
9 Posts |
Posted - 2007-11-15 : 17:42:38
|
Thank you khtan its works :) |
 |
|
|
|
|