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 |
prashantdighe
Starting Member
21 Posts |
Posted - 2012-05-14 : 00:59:29
|
Please help!!!!!SELECT Contribution, SUM(CASE WHEN Contribution >= 4 AND Contribution <> 10 THEN Contribution ELSE NULL end) as ContrFROM program_rating where Program_name=@P_name group by Session_taken_By,Session_Titleerror!!!!!Msg 8120, Level 16, State 1, Procedure Pivot_Report_Rating_only_Day, Line 12 |
|
prashantdighe
Starting Member
21 Posts |
Posted - 2012-05-14 : 01:00:44
|
Please help!!!!!SELECTContribution,SUM(CASEWHEN Contribution >= 4 AND Contribution <> 10THEN ContributionELSE NULLend) as ContrFROM program_rating where Program_name=@P_name group by Session_taken_By,Session_Titleerror!!!!!Msg 8120, Level 16, State 1, Procedure Pivot_Report_Rating_only_Day, Line 12Column 'program_rating.Contribution' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. |
 |
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2012-05-14 : 04:54:02
|
Please try this SELECT---Contribution,Session_taken_By,Session_TitleSUM(CASEWHEN Contribution >= 4 AND Contribution <> 10THEN ContributionELSE NULLend) as ContrFROM program_rating where Program_name=@P_name group by Session_taken_By,Session_TitleVijay is here to learn something from you guys. |
 |
|
|
|
|
|
|