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 |
|
OldMySQLUser
Constraint Violating Yak Guru
301 Posts |
Posted - 2008-01-06 : 11:09:08
|
| Using MS SQL 2005 server how can I get the average cost price of item 'shirt' from this table please?code item description cost retail---- ---- ----------- ---- ------191 shirt shirt - white 2.30 9.99170 pants pants - beige 6.34 15.00196 shirt shirt - red 2.64 9.99199 shirt shirt - blue 2.61 9.99 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-01-06 : 11:10:34
|
| select item, avg(cost) as avgCostfrom YourTablewhere item = 'shirt'group by item_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out |
 |
|
|
OldMySQLUser
Constraint Violating Yak Guru
301 Posts |
Posted - 2008-01-06 : 11:32:34
|
| Many thanks. |
 |
|
|
|
|
|