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 |
|
ryanlcs
Yak Posting Veteran
62 Posts |
Posted - 2010-01-03 : 20:39:30
|
| HiI have a query that will contain aggregate function, but within the statement, I need a sub-query, but it will throws me a error. Saying "Cannot perform an aggregate function on an expression containing an aggregate or a subquery." How can I get this fix?Select case when sum(case when Tester <> 'Overall' and Channel IN (Select Channel From TABLE1 Where Description = 'TOP' and Channel_Group = 'H1')then tester_count else 0 end ) > 0 then sum(case when Tester= 'Overall' and Channel = 'H1' then channel_Qty else 0 end ) else Null end as 'RESULT'from TABLE2Thank You. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|