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 |
|
kporg
Starting Member
5 Posts |
Posted - 2008-01-29 : 15:50:01
|
| I have a table that looks like thisUniqueID Score1 67 1 782 333 771 892 100I want a resultset that looks like thisUniqueID Average1 782 66.53 77How do I get it???Please help............and Thanks! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-01-29 : 15:51:45
|
| SELECT UniqueID, AVG(Score) AS AverageFROM YourTableGROUP BY UniqueIDTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
kporg
Starting Member
5 Posts |
Posted - 2008-01-29 : 16:14:44
|
Very Cool - now lets say I wanted to write those results into a table like thisUniqueID AverageThanks again |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-01-29 : 16:17:36
|
Do you want to continue Tara?This is way to difficult for me... E 12°55'05.25"N 56°04'39.16" |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-01-30 : 15:49:44
|
kporg, use SELECT INTO to put the results into a table. Check BOL for details on the syntax.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
kporg
Starting Member
5 Posts |
Posted - 2008-01-31 : 11:37:54
|
| Got it! Thanks! |
 |
|
|
|
|
|