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 |
Alex2011
Starting Member
18 Posts |
Posted - 2011-04-27 : 14:04:30
|
HI, I am a beginner of SQL and wanted to get some help. select col1, max(col3) as maxcol3from tablegroup by col1col1 col2 col3a a-3 20a a-0 80b b-9 100b b-3 200I want to add col2 and its value should be from the row where max(col3) exists. so the return for above would becol1 col2 col3a a-0 80b b-3 200how to change the SQL statements above to achieve this. Appreciate any help. Alex |
|
robvolk
Most Valuable Yak
15732 Posts |
|
|
|
|