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 |
bilencekic
Posting Yak Master
121 Posts |
Posted - 2006-12-22 : 07:48:08
|
i have a table like thisID-----Word-----Value1-----Jack-----12-----Joe-----43-----Jack----74-----joe-----65-----Jack-----0Well i need the word and the values which is the max on the same word.Without ID column i can get this resultJack-----7Joe-----6but i want the ID column tooso result will be like3-----Jack-----74-----Joe-----6so what is the query for this?MS BLESS US |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-22 : 07:57:00
|
select t1.* from(select word, max(value) mv from table group by word) xinner join table t1 on t1.word = x.word and t1.value = x.mvPeter LarssonHelsingborg, Sweden |
 |
|
bilencekic
Posting Yak Master
121 Posts |
Posted - 2006-12-22 : 08:04:33
|
god will send you to the paratise =) i am sure.thx it worked.MS BLESS US |
 |
|
|
|
|