|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#16
|
||||
|
||||
|
Code:
select relat_to
, sum( coalesce(q1_1,0)
+ coalesce(q1_2,0)
+ coalesce(q1_3,0)
+ coalesce(q1_4,0) ) / 4 as average_q1
from dbo.tbl_client
where relat_to='manager'
and group_name = 'MMColParam'
note you don't really need to GROUP BY on relat_to because your WHERE clause restricts it to only one value rudy |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > SQL Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|