Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Select ID , SUM(costs) AS costs1 , Sum ( Case when (type = 1 or type = 4) then Amount else 0 End) as costs2 from costs Group by ID
Select ID , SUM(costs) AS costs1 ,Date_of_Payment AS MyDate Sum ( Case when (type = 1 or type = 4 AND Year (Date_of_Payment) = 2013 then Amount else 0 End) as costs2 from costs Group by ID
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|T-SQL: Trying to use a "NOT IN (Subquery)" in CASE Statement||2||30|
|Windows Server 2003 STD SP2 as a member server of 2016 domain||11||95|
|SQL: Default Database Integrity Jobs Failing||6||26|
|Generate list for insert to sql list||44||9|
Join the community of 500,000 technology professionals and ask your questions.